d3d10core: Implement ID3D10Multithread.
[wine/multimedia.git] / dlls / d3drm / texture.c
blob8e12409dab6d03ec8cc8502b48336b3e4e3d343b
1 /*
2 * Implementation of IDirect3DRMTextureX interfaces
4 * Copyright 2012 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/debug.h"
23 #define COBJMACROS
25 #include "winbase.h"
26 #include "wingdi.h"
28 #include "d3drm_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
32 struct d3drm_texture
34 IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
35 IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
36 LONG ref;
37 DWORD app_data;
40 static inline struct d3drm_texture *impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2 *iface)
42 return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture2_iface);
45 static inline struct d3drm_texture *impl_from_IDirect3DRMTexture3(IDirect3DRMTexture3 *iface)
47 return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture3_iface);
50 static HRESULT WINAPI d3drm_texture2_QueryInterface(IDirect3DRMTexture2 *iface, REFIID riid, void **out)
52 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
54 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
56 if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2)
57 || IsEqualGUID(riid, &IID_IDirect3DRMTexture)
58 || IsEqualGUID(riid, &IID_IUnknown))
60 *out = &texture->IDirect3DRMTexture2_iface;
62 else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
64 *out = &texture->IDirect3DRMTexture3_iface;
66 else
68 *out = NULL;
69 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
70 return E_NOINTERFACE;
73 IUnknown_AddRef((IUnknown *)*out);
74 return S_OK;
77 static ULONG WINAPI d3drm_texture2_AddRef(IDirect3DRMTexture2 *iface)
79 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
80 ULONG refcount = InterlockedIncrement(&texture->ref);
82 TRACE("%p increasing refcount to %u.\n", iface, refcount);
84 return refcount;
87 static ULONG WINAPI d3drm_texture2_Release(IDirect3DRMTexture2 *iface)
89 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
90 ULONG refcount = InterlockedDecrement(&texture->ref);
92 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
94 if (!refcount)
95 HeapFree(GetProcessHeap(), 0, texture);
97 return refcount;
100 static HRESULT WINAPI d3drm_texture2_Clone(IDirect3DRMTexture2 *iface,
101 IUnknown *outer, REFIID iid, void **out)
103 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
105 return E_NOTIMPL;
108 static HRESULT WINAPI d3drm_texture2_AddDestroyCallback(IDirect3DRMTexture2 *iface,
109 D3DRMOBJECTCALLBACK cb, void *ctx)
111 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
113 return E_NOTIMPL;
116 static HRESULT WINAPI d3drm_texture2_DeleteDestroyCallback(IDirect3DRMTexture2 *iface,
117 D3DRMOBJECTCALLBACK cb, void *ctx)
119 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
121 return E_NOTIMPL;
124 static HRESULT WINAPI d3drm_texture2_SetAppData(IDirect3DRMTexture2 *iface, DWORD data)
126 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
128 TRACE("iface %p, data %#x.\n", iface, data);
130 return IDirect3DRMTexture3_SetAppData(&texture->IDirect3DRMTexture3_iface, data);
133 static DWORD WINAPI d3drm_texture2_GetAppData(IDirect3DRMTexture2 *iface)
135 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
137 TRACE("iface %p.\n", iface);
139 return IDirect3DRMTexture3_GetAppData(&texture->IDirect3DRMTexture3_iface);
142 static HRESULT WINAPI d3drm_texture2_SetName(IDirect3DRMTexture2 *iface, const char *name)
144 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
146 return E_NOTIMPL;
149 static HRESULT WINAPI d3drm_texture2_GetName(IDirect3DRMTexture2 *iface, DWORD *size, char *name)
151 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
153 return E_NOTIMPL;
156 static HRESULT WINAPI d3drm_texture2_GetClassName(IDirect3DRMTexture2 *iface, DWORD *size, char *name)
158 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
160 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
162 return IDirect3DRMTexture3_GetClassName(&texture->IDirect3DRMTexture3_iface, size, name);
165 static HRESULT WINAPI d3drm_texture2_InitFromFile(IDirect3DRMTexture2 *iface, const char *filename)
167 FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename));
169 return E_NOTIMPL;
172 static HRESULT WINAPI d3drm_texture2_InitFromSurface(IDirect3DRMTexture2 *iface,
173 IDirectDrawSurface *surface)
175 FIXME("iface %p, surface %p stub!\n", iface, surface);
177 return E_NOTIMPL;
180 static HRESULT WINAPI d3drm_texture2_InitFromResource(IDirect3DRMTexture2 *iface, HRSRC resource)
182 FIXME("iface %p, resource %p stub!\n", iface, resource);
184 return E_NOTIMPL;
187 static HRESULT WINAPI d3drm_texture2_Changed(IDirect3DRMTexture2 *iface, BOOL pixels, BOOL palette)
189 FIXME("iface %p, pixels %#x, palette %#x stub!\n", iface, pixels, palette);
191 return E_NOTIMPL;
194 static HRESULT WINAPI d3drm_texture2_SetColors(IDirect3DRMTexture2 *iface, DWORD max_colors)
196 FIXME("iface %p, max_colors %u stub!\n", iface, max_colors);
198 return E_NOTIMPL;
201 static HRESULT WINAPI d3drm_texture2_SetShades(IDirect3DRMTexture2 *iface, DWORD max_shades)
203 FIXME("iface %p, max_shades %u stub!\n", iface, max_shades);
205 return E_NOTIMPL;
208 static HRESULT WINAPI d3drm_texture2_SetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE width, D3DVALUE height)
210 FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
212 return E_NOTIMPL;
215 static HRESULT WINAPI d3drm_texture2_SetDecalOrigin(IDirect3DRMTexture2 *iface, LONG x, LONG y)
217 FIXME("iface %p, x %d, y %d stub!\n", iface, x, y);
219 return E_NOTIMPL;
222 static HRESULT WINAPI d3drm_texture2_SetDecalScale(IDirect3DRMTexture2 *iface, DWORD scale)
224 FIXME("iface %p, scale %u stub!\n", iface, scale);
226 return E_NOTIMPL;
229 static HRESULT WINAPI d3drm_texture2_SetDecalTransparency(IDirect3DRMTexture2 *iface, BOOL transparency)
231 FIXME("iface %p, transparency %#x stub!\n", iface, transparency);
233 return E_NOTIMPL;
236 static HRESULT WINAPI d3drm_texture2_SetDecalTransparentColor(IDirect3DRMTexture2 *iface, D3DCOLOR color)
238 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
240 return E_NOTIMPL;
243 static HRESULT WINAPI d3drm_texture2_GetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE *width, D3DVALUE *height)
245 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
247 return E_NOTIMPL;
250 static HRESULT WINAPI d3drm_texture2_GetDecalOrigin(IDirect3DRMTexture2 *iface, LONG *x, LONG *y)
252 FIXME("iface %p, x %p, y %p stub!\n", iface, x, y);
254 return E_NOTIMPL;
257 static D3DRMIMAGE * WINAPI d3drm_texture2_GetImage(IDirect3DRMTexture2 *iface)
259 FIXME("iface %p stub!\n", iface);
261 return NULL;
264 static DWORD WINAPI d3drm_texture2_GetShades(IDirect3DRMTexture2 *iface)
266 FIXME("iface %p stub!\n", iface);
268 return 0;
271 static DWORD WINAPI d3drm_texture2_GetColors(IDirect3DRMTexture2 *iface)
273 FIXME("iface %p stub!\n", iface);
275 return 0;
278 static DWORD WINAPI d3drm_texture2_GetDecalScale(IDirect3DRMTexture2 *iface)
280 FIXME("iface %p stub!\n", iface);
282 return 0;
285 static BOOL WINAPI d3drm_texture2_GetDecalTransparency(IDirect3DRMTexture2 *iface)
287 FIXME("iface %p stub!\n", iface);
289 return FALSE;
292 static D3DCOLOR WINAPI d3drm_texture2_GetDecalTransparentColor(IDirect3DRMTexture2 *iface)
294 FIXME("iface %p stub!\n", iface);
296 return 0;
299 static HRESULT WINAPI d3drm_texture2_InitFromImage(IDirect3DRMTexture2 *iface, D3DRMIMAGE *image)
301 FIXME("iface %p, image %p stub!\n", iface, image);
303 return E_NOTIMPL;
306 static HRESULT WINAPI d3drm_texture2_InitFromResource2(IDirect3DRMTexture2 *iface,
307 HMODULE module, const char *name, const char *type)
309 FIXME("iface %p, module %p, name %s, type %s stub!\n",
310 iface, module, debugstr_a(name), debugstr_a(type));
312 return E_NOTIMPL;
315 static HRESULT WINAPI d3drm_texture2_GenerateMIPMap(IDirect3DRMTexture2 *iface, DWORD flags)
317 FIXME("iface %p, flags %#x stub!\n", iface, flags);
319 return E_NOTIMPL;
322 static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl =
324 d3drm_texture2_QueryInterface,
325 d3drm_texture2_AddRef,
326 d3drm_texture2_Release,
327 d3drm_texture2_Clone,
328 d3drm_texture2_AddDestroyCallback,
329 d3drm_texture2_DeleteDestroyCallback,
330 d3drm_texture2_SetAppData,
331 d3drm_texture2_GetAppData,
332 d3drm_texture2_SetName,
333 d3drm_texture2_GetName,
334 d3drm_texture2_GetClassName,
335 d3drm_texture2_InitFromFile,
336 d3drm_texture2_InitFromSurface,
337 d3drm_texture2_InitFromResource,
338 d3drm_texture2_Changed,
339 d3drm_texture2_SetColors,
340 d3drm_texture2_SetShades,
341 d3drm_texture2_SetDecalSize,
342 d3drm_texture2_SetDecalOrigin,
343 d3drm_texture2_SetDecalScale,
344 d3drm_texture2_SetDecalTransparency,
345 d3drm_texture2_SetDecalTransparentColor,
346 d3drm_texture2_GetDecalSize,
347 d3drm_texture2_GetDecalOrigin,
348 d3drm_texture2_GetImage,
349 d3drm_texture2_GetShades,
350 d3drm_texture2_GetColors,
351 d3drm_texture2_GetDecalScale,
352 d3drm_texture2_GetDecalTransparency,
353 d3drm_texture2_GetDecalTransparentColor,
354 d3drm_texture2_InitFromImage,
355 d3drm_texture2_InitFromResource2,
356 d3drm_texture2_GenerateMIPMap,
359 static HRESULT WINAPI d3drm_texture3_QueryInterface(IDirect3DRMTexture3 *iface, REFIID riid, void **out)
361 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
363 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
365 if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2)
366 || IsEqualGUID(riid, &IID_IDirect3DRMTexture)
367 || IsEqualGUID(riid, &IID_IUnknown))
369 *out = &texture->IDirect3DRMTexture2_iface;
371 else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
373 *out = &texture->IDirect3DRMTexture3_iface;
375 else
377 *out = NULL;
378 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
379 return E_NOINTERFACE;
382 IUnknown_AddRef((IUnknown *)*out);
383 return S_OK;
386 static ULONG WINAPI d3drm_texture3_AddRef(IDirect3DRMTexture3 *iface)
388 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
389 ULONG refcount = InterlockedIncrement(&texture->ref);
391 TRACE("%p increasing refcount to %u.\n", iface, refcount);
393 return refcount;
396 static ULONG WINAPI d3drm_texture3_Release(IDirect3DRMTexture3 *iface)
398 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
399 ULONG refcount = InterlockedDecrement(&texture->ref);
401 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
403 if (!refcount)
404 HeapFree(GetProcessHeap(), 0, texture);
406 return refcount;
409 static HRESULT WINAPI d3drm_texture3_Clone(IDirect3DRMTexture3 *iface,
410 IUnknown *outer, REFIID iid, void **out)
412 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
414 return E_NOTIMPL;
417 static HRESULT WINAPI d3drm_texture3_AddDestroyCallback(IDirect3DRMTexture3 *iface,
418 D3DRMOBJECTCALLBACK cb, void *ctx)
420 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
422 return E_NOTIMPL;
425 static HRESULT WINAPI d3drm_texture3_DeleteDestroyCallback(IDirect3DRMTexture3 *iface,
426 D3DRMOBJECTCALLBACK cb, void *ctx)
428 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
430 return E_NOTIMPL;
433 static HRESULT WINAPI d3drm_texture3_SetAppData(IDirect3DRMTexture3 *iface, DWORD data)
435 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
437 TRACE("iface %p, data %#x.\n", iface, data);
439 texture->app_data = data;
441 return D3DRM_OK;
444 static DWORD WINAPI d3drm_texture3_GetAppData(IDirect3DRMTexture3 *iface)
446 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
448 TRACE("iface %p.\n", iface);
450 return texture->app_data;
453 static HRESULT WINAPI d3drm_texture3_SetName(IDirect3DRMTexture3 *iface, const char *name)
455 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
457 return E_NOTIMPL;
460 static HRESULT WINAPI d3drm_texture3_GetName(IDirect3DRMTexture3 *iface, DWORD *size, char *name)
462 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
464 return E_NOTIMPL;
467 static HRESULT WINAPI d3drm_texture3_GetClassName(IDirect3DRMTexture3 *iface, DWORD *size, char *name)
469 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
471 if (!size || *size < strlen("Texture") || !name)
472 return E_INVALIDARG;
474 strcpy(name, "Texture");
475 *size = sizeof("Texture");
477 return D3DRM_OK;
480 static HRESULT WINAPI d3drm_texture3_InitFromFile(IDirect3DRMTexture3 *iface, const char *filename)
482 FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename));
484 return E_NOTIMPL;
487 static HRESULT WINAPI d3drm_texture3_InitFromSurface(IDirect3DRMTexture3 *iface,
488 IDirectDrawSurface *surface)
490 FIXME("iface %p, surface %p stub!\n", iface, surface);
492 return E_NOTIMPL;
495 static HRESULT WINAPI d3drm_texture3_InitFromResource(IDirect3DRMTexture3 *iface, HRSRC resource)
497 FIXME("iface %p, resource %p stub!\n", iface, resource);
499 return E_NOTIMPL;
502 static HRESULT WINAPI d3drm_texture3_Changed(IDirect3DRMTexture3 *iface,
503 DWORD flags, DWORD rect_count, RECT *rects)
505 FIXME("iface %p, flags %#x, rect_count %u, rects %p stub!\n", iface, flags, rect_count, rects);
507 return E_NOTIMPL;
510 static HRESULT WINAPI d3drm_texture3_SetColors(IDirect3DRMTexture3 *iface, DWORD max_colors)
512 FIXME("iface %p, max_colors %u stub!\n", iface, max_colors);
514 return E_NOTIMPL;
517 static HRESULT WINAPI d3drm_texture3_SetShades(IDirect3DRMTexture3 *iface, DWORD max_shades)
519 FIXME("iface %p, max_shades %u stub!\n", iface, max_shades);
521 return E_NOTIMPL;
524 static HRESULT WINAPI d3drm_texture3_SetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE width, D3DVALUE height)
526 FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
528 return E_NOTIMPL;
531 static HRESULT WINAPI d3drm_texture3_SetDecalOrigin(IDirect3DRMTexture3 *iface, LONG x, LONG y)
533 FIXME("iface %p, x %d, y %d stub!\n", iface, x, y);
535 return E_NOTIMPL;
538 static HRESULT WINAPI d3drm_texture3_SetDecalScale(IDirect3DRMTexture3 *iface, DWORD scale)
540 FIXME("iface %p, scale %u stub!\n", iface, scale);
542 return E_NOTIMPL;
545 static HRESULT WINAPI d3drm_texture3_SetDecalTransparency(IDirect3DRMTexture3 *iface, BOOL transparency)
547 FIXME("iface %p, transparency %#x stub!\n", iface, transparency);
549 return E_NOTIMPL;
552 static HRESULT WINAPI d3drm_texture3_SetDecalTransparentColor(IDirect3DRMTexture3 *iface, D3DCOLOR color)
554 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
556 return E_NOTIMPL;
559 static HRESULT WINAPI d3drm_texture3_GetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE *width, D3DVALUE *height)
561 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
563 return E_NOTIMPL;
566 static HRESULT WINAPI d3drm_texture3_GetDecalOrigin(IDirect3DRMTexture3 *iface, LONG *x, LONG *y)
568 FIXME("iface %p, x %p, y %p stub!\n", iface, x, y);
570 return E_NOTIMPL;
573 static D3DRMIMAGE * WINAPI d3drm_texture3_GetImage(IDirect3DRMTexture3 *iface)
575 FIXME("iface %p stub!\n", iface);
577 return NULL;
580 static DWORD WINAPI d3drm_texture3_GetShades(IDirect3DRMTexture3 *iface)
582 FIXME("iface %p stub!\n", iface);
584 return 0;
587 static DWORD WINAPI d3drm_texture3_GetColors(IDirect3DRMTexture3 *iface)
589 FIXME("iface %p stub!\n", iface);
591 return 0;
594 static DWORD WINAPI d3drm_texture3_GetDecalScale(IDirect3DRMTexture3 *iface)
596 FIXME("iface %p stub!\n", iface);
598 return 0;
601 static BOOL WINAPI d3drm_texture3_GetDecalTransparency(IDirect3DRMTexture3 *iface)
603 FIXME("iface %p stub!\n", iface);
605 return FALSE;
608 static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor(IDirect3DRMTexture3 *iface)
610 FIXME("iface %p stub!\n", iface);
612 return 0;
615 static HRESULT WINAPI d3drm_texture3_InitFromImage(IDirect3DRMTexture3 *iface, D3DRMIMAGE *image)
617 FIXME("iface %p, image %p stub!\n", iface, image);
619 return E_NOTIMPL;
622 static HRESULT WINAPI d3drm_texture3_InitFromResource2(IDirect3DRMTexture3 *iface,
623 HMODULE module, const char *name, const char *type)
625 FIXME("iface %p, module %p, name %s, type %s stub!\n",
626 iface, module, debugstr_a(name), debugstr_a(type));
628 return E_NOTIMPL;
631 static HRESULT WINAPI d3drm_texture3_GenerateMIPMap(IDirect3DRMTexture3 *iface, DWORD flags)
633 FIXME("iface %p, flags %#x stub!\n", iface, flags);
635 return E_NOTIMPL;
638 static HRESULT WINAPI d3drm_texture3_GetSurface(IDirect3DRMTexture3 *iface,
639 DWORD flags, IDirectDrawSurface **surface)
641 FIXME("iface %p, flags %#x, surface %p stub!\n", iface, flags, surface);
643 return E_NOTIMPL;
646 static HRESULT WINAPI d3drm_texture3_SetCacheOptions(IDirect3DRMTexture3 *iface, LONG importance, DWORD flags)
648 FIXME("iface %p, importance %d, flags %#x stub!\n", iface, importance, flags);
650 return E_NOTIMPL;
653 static HRESULT WINAPI d3drm_texture3_GetCacheOptions(IDirect3DRMTexture3 *iface,
654 LONG *importance, DWORD *flags)
656 FIXME("iface %p, importance %p, flags %p stub!\n", iface, importance, flags);
658 return E_NOTIMPL;
661 static HRESULT WINAPI d3drm_texture3_SetDownsampleCallback(IDirect3DRMTexture3 *iface,
662 D3DRMDOWNSAMPLECALLBACK cb, void *ctx)
664 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
666 return E_NOTIMPL;
669 static HRESULT WINAPI d3drm_texture3_SetValidationCallback(IDirect3DRMTexture3 *iface,
670 D3DRMVALIDATIONCALLBACK cb, void *ctx)
672 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
674 return E_NOTIMPL;
677 static const struct IDirect3DRMTexture3Vtbl d3drm_texture3_vtbl =
679 d3drm_texture3_QueryInterface,
680 d3drm_texture3_AddRef,
681 d3drm_texture3_Release,
682 d3drm_texture3_Clone,
683 d3drm_texture3_AddDestroyCallback,
684 d3drm_texture3_DeleteDestroyCallback,
685 d3drm_texture3_SetAppData,
686 d3drm_texture3_GetAppData,
687 d3drm_texture3_SetName,
688 d3drm_texture3_GetName,
689 d3drm_texture3_GetClassName,
690 d3drm_texture3_InitFromFile,
691 d3drm_texture3_InitFromSurface,
692 d3drm_texture3_InitFromResource,
693 d3drm_texture3_Changed,
694 d3drm_texture3_SetColors,
695 d3drm_texture3_SetShades,
696 d3drm_texture3_SetDecalSize,
697 d3drm_texture3_SetDecalOrigin,
698 d3drm_texture3_SetDecalScale,
699 d3drm_texture3_SetDecalTransparency,
700 d3drm_texture3_SetDecalTransparentColor,
701 d3drm_texture3_GetDecalSize,
702 d3drm_texture3_GetDecalOrigin,
703 d3drm_texture3_GetImage,
704 d3drm_texture3_GetShades,
705 d3drm_texture3_GetColors,
706 d3drm_texture3_GetDecalScale,
707 d3drm_texture3_GetDecalTransparency,
708 d3drm_texture3_GetDecalTransparentColor,
709 d3drm_texture3_InitFromImage,
710 d3drm_texture3_InitFromResource2,
711 d3drm_texture3_GenerateMIPMap,
712 d3drm_texture3_GetSurface,
713 d3drm_texture3_SetCacheOptions,
714 d3drm_texture3_GetCacheOptions,
715 d3drm_texture3_SetDownsampleCallback,
716 d3drm_texture3_SetValidationCallback,
719 HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown **out)
721 struct d3drm_texture *object;
723 TRACE("riid %s, out %p.\n", debugstr_guid(riid), out);
725 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
726 return E_OUTOFMEMORY;
728 object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl;
729 object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl;
730 object->ref = 1;
732 if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
733 *out = (IUnknown *)&object->IDirect3DRMTexture3_iface;
734 else
735 *out = (IUnknown *)&object->IDirect3DRMTexture2_iface;
737 return S_OK;