fb580a1fcf9f595d5f331f517d1dfecd248e57af
[reactos.git] / reactos / dll / directx / wine / d3drm / texture.c
1 /*
2 * Implementation of IDirect3DRMTextureX interfaces
3 *
4 * Copyright 2012 Christian Costa
5 *
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.
10 *
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.
15 *
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
19 */
20
21 #include "d3drm_private.h"
22
23 struct d3drm_texture
24 {
25 IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
26 IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
27 LONG ref;
28 DWORD app_data;
29 };
30
31 static inline struct d3drm_texture *impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2 *iface)
32 {
33 return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture2_iface);
34 }
35
36 static inline struct d3drm_texture *impl_from_IDirect3DRMTexture3(IDirect3DRMTexture3 *iface)
37 {
38 return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture3_iface);
39 }
40
41 static HRESULT WINAPI d3drm_texture2_QueryInterface(IDirect3DRMTexture2 *iface, REFIID riid, void **out)
42 {
43 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
44
45 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
46
47 if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2)
48 || IsEqualGUID(riid, &IID_IDirect3DRMTexture)
49 || IsEqualGUID(riid, &IID_IUnknown))
50 {
51 *out = &texture->IDirect3DRMTexture2_iface;
52 }
53 else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
54 {
55 *out = &texture->IDirect3DRMTexture3_iface;
56 }
57 else
58 {
59 *out = NULL;
60 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
61 return E_NOINTERFACE;
62 }
63
64 IUnknown_AddRef((IUnknown *)*out);
65 return S_OK;
66 }
67
68 static ULONG WINAPI d3drm_texture2_AddRef(IDirect3DRMTexture2 *iface)
69 {
70 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
71 ULONG refcount = InterlockedIncrement(&texture->ref);
72
73 TRACE("%p increasing refcount to %u.\n", iface, refcount);
74
75 return refcount;
76 }
77
78 static ULONG WINAPI d3drm_texture2_Release(IDirect3DRMTexture2 *iface)
79 {
80 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
81 ULONG refcount = InterlockedDecrement(&texture->ref);
82
83 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
84
85 if (!refcount)
86 HeapFree(GetProcessHeap(), 0, texture);
87
88 return refcount;
89 }
90
91 static HRESULT WINAPI d3drm_texture2_Clone(IDirect3DRMTexture2 *iface,
92 IUnknown *outer, REFIID iid, void **out)
93 {
94 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
95
96 return E_NOTIMPL;
97 }
98
99 static HRESULT WINAPI d3drm_texture2_AddDestroyCallback(IDirect3DRMTexture2 *iface,
100 D3DRMOBJECTCALLBACK cb, void *ctx)
101 {
102 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
103
104 return E_NOTIMPL;
105 }
106
107 static HRESULT WINAPI d3drm_texture2_DeleteDestroyCallback(IDirect3DRMTexture2 *iface,
108 D3DRMOBJECTCALLBACK cb, void *ctx)
109 {
110 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
111
112 return E_NOTIMPL;
113 }
114
115 static HRESULT WINAPI d3drm_texture2_SetAppData(IDirect3DRMTexture2 *iface, DWORD data)
116 {
117 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
118
119 TRACE("iface %p, data %#x.\n", iface, data);
120
121 return IDirect3DRMTexture3_SetAppData(&texture->IDirect3DRMTexture3_iface, data);
122 }
123
124 static DWORD WINAPI d3drm_texture2_GetAppData(IDirect3DRMTexture2 *iface)
125 {
126 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
127
128 TRACE("iface %p.\n", iface);
129
130 return IDirect3DRMTexture3_GetAppData(&texture->IDirect3DRMTexture3_iface);
131 }
132
133 static HRESULT WINAPI d3drm_texture2_SetName(IDirect3DRMTexture2 *iface, const char *name)
134 {
135 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
136
137 return E_NOTIMPL;
138 }
139
140 static HRESULT WINAPI d3drm_texture2_GetName(IDirect3DRMTexture2 *iface, DWORD *size, char *name)
141 {
142 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
143
144 return E_NOTIMPL;
145 }
146
147 static HRESULT WINAPI d3drm_texture2_GetClassName(IDirect3DRMTexture2 *iface, DWORD *size, char *name)
148 {
149 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
150
151 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
152
153 return IDirect3DRMTexture3_GetClassName(&texture->IDirect3DRMTexture3_iface, size, name);
154 }
155
156 static HRESULT WINAPI d3drm_texture2_InitFromFile(IDirect3DRMTexture2 *iface, const char *filename)
157 {
158 FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename));
159
160 return E_NOTIMPL;
161 }
162
163 static HRESULT WINAPI d3drm_texture2_InitFromSurface(IDirect3DRMTexture2 *iface,
164 IDirectDrawSurface *surface)
165 {
166 FIXME("iface %p, surface %p stub!\n", iface, surface);
167
168 return E_NOTIMPL;
169 }
170
171 static HRESULT WINAPI d3drm_texture2_InitFromResource(IDirect3DRMTexture2 *iface, HRSRC resource)
172 {
173 FIXME("iface %p, resource %p stub!\n", iface, resource);
174
175 return E_NOTIMPL;
176 }
177
178 static HRESULT WINAPI d3drm_texture2_Changed(IDirect3DRMTexture2 *iface, BOOL pixels, BOOL palette)
179 {
180 FIXME("iface %p, pixels %#x, palette %#x stub!\n", iface, pixels, palette);
181
182 return E_NOTIMPL;
183 }
184
185 static HRESULT WINAPI d3drm_texture2_SetColors(IDirect3DRMTexture2 *iface, DWORD max_colors)
186 {
187 FIXME("iface %p, max_colors %u stub!\n", iface, max_colors);
188
189 return E_NOTIMPL;
190 }
191
192 static HRESULT WINAPI d3drm_texture2_SetShades(IDirect3DRMTexture2 *iface, DWORD max_shades)
193 {
194 FIXME("iface %p, max_shades %u stub!\n", iface, max_shades);
195
196 return E_NOTIMPL;
197 }
198
199 static HRESULT WINAPI d3drm_texture2_SetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE width, D3DVALUE height)
200 {
201 FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
202
203 return E_NOTIMPL;
204 }
205
206 static HRESULT WINAPI d3drm_texture2_SetDecalOrigin(IDirect3DRMTexture2 *iface, LONG x, LONG y)
207 {
208 FIXME("iface %p, x %d, y %d stub!\n", iface, x, y);
209
210 return E_NOTIMPL;
211 }
212
213 static HRESULT WINAPI d3drm_texture2_SetDecalScale(IDirect3DRMTexture2 *iface, DWORD scale)
214 {
215 FIXME("iface %p, scale %u stub!\n", iface, scale);
216
217 return E_NOTIMPL;
218 }
219
220 static HRESULT WINAPI d3drm_texture2_SetDecalTransparency(IDirect3DRMTexture2 *iface, BOOL transparency)
221 {
222 FIXME("iface %p, transparency %#x stub!\n", iface, transparency);
223
224 return E_NOTIMPL;
225 }
226
227 static HRESULT WINAPI d3drm_texture2_SetDecalTransparentColor(IDirect3DRMTexture2 *iface, D3DCOLOR color)
228 {
229 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
230
231 return E_NOTIMPL;
232 }
233
234 static HRESULT WINAPI d3drm_texture2_GetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE *width, D3DVALUE *height)
235 {
236 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
237
238 return E_NOTIMPL;
239 }
240
241 static HRESULT WINAPI d3drm_texture2_GetDecalOrigin(IDirect3DRMTexture2 *iface, LONG *x, LONG *y)
242 {
243 FIXME("iface %p, x %p, y %p stub!\n", iface, x, y);
244
245 return E_NOTIMPL;
246 }
247
248 static D3DRMIMAGE * WINAPI d3drm_texture2_GetImage(IDirect3DRMTexture2 *iface)
249 {
250 FIXME("iface %p stub!\n", iface);
251
252 return NULL;
253 }
254
255 static DWORD WINAPI d3drm_texture2_GetShades(IDirect3DRMTexture2 *iface)
256 {
257 FIXME("iface %p stub!\n", iface);
258
259 return 0;
260 }
261
262 static DWORD WINAPI d3drm_texture2_GetColors(IDirect3DRMTexture2 *iface)
263 {
264 FIXME("iface %p stub!\n", iface);
265
266 return 0;
267 }
268
269 static DWORD WINAPI d3drm_texture2_GetDecalScale(IDirect3DRMTexture2 *iface)
270 {
271 FIXME("iface %p stub!\n", iface);
272
273 return 0;
274 }
275
276 static BOOL WINAPI d3drm_texture2_GetDecalTransparency(IDirect3DRMTexture2 *iface)
277 {
278 FIXME("iface %p stub!\n", iface);
279
280 return FALSE;
281 }
282
283 static D3DCOLOR WINAPI d3drm_texture2_GetDecalTransparentColor(IDirect3DRMTexture2 *iface)
284 {
285 FIXME("iface %p stub!\n", iface);
286
287 return 0;
288 }
289
290 static HRESULT WINAPI d3drm_texture2_InitFromImage(IDirect3DRMTexture2 *iface, D3DRMIMAGE *image)
291 {
292 FIXME("iface %p, image %p stub!\n", iface, image);
293
294 return E_NOTIMPL;
295 }
296
297 static HRESULT WINAPI d3drm_texture2_InitFromResource2(IDirect3DRMTexture2 *iface,
298 HMODULE module, const char *name, const char *type)
299 {
300 FIXME("iface %p, module %p, name %s, type %s stub!\n",
301 iface, module, debugstr_a(name), debugstr_a(type));
302
303 return E_NOTIMPL;
304 }
305
306 static HRESULT WINAPI d3drm_texture2_GenerateMIPMap(IDirect3DRMTexture2 *iface, DWORD flags)
307 {
308 FIXME("iface %p, flags %#x stub!\n", iface, flags);
309
310 return E_NOTIMPL;
311 }
312
313 static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl =
314 {
315 d3drm_texture2_QueryInterface,
316 d3drm_texture2_AddRef,
317 d3drm_texture2_Release,
318 d3drm_texture2_Clone,
319 d3drm_texture2_AddDestroyCallback,
320 d3drm_texture2_DeleteDestroyCallback,
321 d3drm_texture2_SetAppData,
322 d3drm_texture2_GetAppData,
323 d3drm_texture2_SetName,
324 d3drm_texture2_GetName,
325 d3drm_texture2_GetClassName,
326 d3drm_texture2_InitFromFile,
327 d3drm_texture2_InitFromSurface,
328 d3drm_texture2_InitFromResource,
329 d3drm_texture2_Changed,
330 d3drm_texture2_SetColors,
331 d3drm_texture2_SetShades,
332 d3drm_texture2_SetDecalSize,
333 d3drm_texture2_SetDecalOrigin,
334 d3drm_texture2_SetDecalScale,
335 d3drm_texture2_SetDecalTransparency,
336 d3drm_texture2_SetDecalTransparentColor,
337 d3drm_texture2_GetDecalSize,
338 d3drm_texture2_GetDecalOrigin,
339 d3drm_texture2_GetImage,
340 d3drm_texture2_GetShades,
341 d3drm_texture2_GetColors,
342 d3drm_texture2_GetDecalScale,
343 d3drm_texture2_GetDecalTransparency,
344 d3drm_texture2_GetDecalTransparentColor,
345 d3drm_texture2_InitFromImage,
346 d3drm_texture2_InitFromResource2,
347 d3drm_texture2_GenerateMIPMap,
348 };
349
350 static HRESULT WINAPI d3drm_texture3_QueryInterface(IDirect3DRMTexture3 *iface, REFIID riid, void **out)
351 {
352 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
353
354 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
355
356 if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2)
357 || IsEqualGUID(riid, &IID_IDirect3DRMTexture)
358 || IsEqualGUID(riid, &IID_IUnknown))
359 {
360 *out = &texture->IDirect3DRMTexture2_iface;
361 }
362 else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
363 {
364 *out = &texture->IDirect3DRMTexture3_iface;
365 }
366 else
367 {
368 *out = NULL;
369 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
370 return E_NOINTERFACE;
371 }
372
373 IUnknown_AddRef((IUnknown *)*out);
374 return S_OK;
375 }
376
377 static ULONG WINAPI d3drm_texture3_AddRef(IDirect3DRMTexture3 *iface)
378 {
379 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
380 ULONG refcount = InterlockedIncrement(&texture->ref);
381
382 TRACE("%p increasing refcount to %u.\n", iface, refcount);
383
384 return refcount;
385 }
386
387 static ULONG WINAPI d3drm_texture3_Release(IDirect3DRMTexture3 *iface)
388 {
389 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
390 ULONG refcount = InterlockedDecrement(&texture->ref);
391
392 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
393
394 if (!refcount)
395 HeapFree(GetProcessHeap(), 0, texture);
396
397 return refcount;
398 }
399
400 static HRESULT WINAPI d3drm_texture3_Clone(IDirect3DRMTexture3 *iface,
401 IUnknown *outer, REFIID iid, void **out)
402 {
403 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
404
405 return E_NOTIMPL;
406 }
407
408 static HRESULT WINAPI d3drm_texture3_AddDestroyCallback(IDirect3DRMTexture3 *iface,
409 D3DRMOBJECTCALLBACK cb, void *ctx)
410 {
411 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
412
413 return E_NOTIMPL;
414 }
415
416 static HRESULT WINAPI d3drm_texture3_DeleteDestroyCallback(IDirect3DRMTexture3 *iface,
417 D3DRMOBJECTCALLBACK cb, void *ctx)
418 {
419 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
420
421 return E_NOTIMPL;
422 }
423
424 static HRESULT WINAPI d3drm_texture3_SetAppData(IDirect3DRMTexture3 *iface, DWORD data)
425 {
426 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
427
428 TRACE("iface %p, data %#x.\n", iface, data);
429
430 texture->app_data = data;
431
432 return D3DRM_OK;
433 }
434
435 static DWORD WINAPI d3drm_texture3_GetAppData(IDirect3DRMTexture3 *iface)
436 {
437 struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
438
439 TRACE("iface %p.\n", iface);
440
441 return texture->app_data;
442 }
443
444 static HRESULT WINAPI d3drm_texture3_SetName(IDirect3DRMTexture3 *iface, const char *name)
445 {
446 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
447
448 return E_NOTIMPL;
449 }
450
451 static HRESULT WINAPI d3drm_texture3_GetName(IDirect3DRMTexture3 *iface, DWORD *size, char *name)
452 {
453 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
454
455 return E_NOTIMPL;
456 }
457
458 static HRESULT WINAPI d3drm_texture3_GetClassName(IDirect3DRMTexture3 *iface, DWORD *size, char *name)
459 {
460 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
461
462 if (!size || *size < strlen("Texture") || !name)
463 return E_INVALIDARG;
464
465 strcpy(name, "Texture");
466 *size = sizeof("Texture");
467
468 return D3DRM_OK;
469 }
470
471 static HRESULT WINAPI d3drm_texture3_InitFromFile(IDirect3DRMTexture3 *iface, const char *filename)
472 {
473 FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename));
474
475 return E_NOTIMPL;
476 }
477
478 static HRESULT WINAPI d3drm_texture3_InitFromSurface(IDirect3DRMTexture3 *iface,
479 IDirectDrawSurface *surface)
480 {
481 FIXME("iface %p, surface %p stub!\n", iface, surface);
482
483 return E_NOTIMPL;
484 }
485
486 static HRESULT WINAPI d3drm_texture3_InitFromResource(IDirect3DRMTexture3 *iface, HRSRC resource)
487 {
488 FIXME("iface %p, resource %p stub!\n", iface, resource);
489
490 return E_NOTIMPL;
491 }
492
493 static HRESULT WINAPI d3drm_texture3_Changed(IDirect3DRMTexture3 *iface,
494 DWORD flags, DWORD rect_count, RECT *rects)
495 {
496 FIXME("iface %p, flags %#x, rect_count %u, rects %p stub!\n", iface, flags, rect_count, rects);
497
498 return E_NOTIMPL;
499 }
500
501 static HRESULT WINAPI d3drm_texture3_SetColors(IDirect3DRMTexture3 *iface, DWORD max_colors)
502 {
503 FIXME("iface %p, max_colors %u stub!\n", iface, max_colors);
504
505 return E_NOTIMPL;
506 }
507
508 static HRESULT WINAPI d3drm_texture3_SetShades(IDirect3DRMTexture3 *iface, DWORD max_shades)
509 {
510 FIXME("iface %p, max_shades %u stub!\n", iface, max_shades);
511
512 return E_NOTIMPL;
513 }
514
515 static HRESULT WINAPI d3drm_texture3_SetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE width, D3DVALUE height)
516 {
517 FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
518
519 return E_NOTIMPL;
520 }
521
522 static HRESULT WINAPI d3drm_texture3_SetDecalOrigin(IDirect3DRMTexture3 *iface, LONG x, LONG y)
523 {
524 FIXME("iface %p, x %d, y %d stub!\n", iface, x, y);
525
526 return E_NOTIMPL;
527 }
528
529 static HRESULT WINAPI d3drm_texture3_SetDecalScale(IDirect3DRMTexture3 *iface, DWORD scale)
530 {
531 FIXME("iface %p, scale %u stub!\n", iface, scale);
532
533 return E_NOTIMPL;
534 }
535
536 static HRESULT WINAPI d3drm_texture3_SetDecalTransparency(IDirect3DRMTexture3 *iface, BOOL transparency)
537 {
538 FIXME("iface %p, transparency %#x stub!\n", iface, transparency);
539
540 return E_NOTIMPL;
541 }
542
543 static HRESULT WINAPI d3drm_texture3_SetDecalTransparentColor(IDirect3DRMTexture3 *iface, D3DCOLOR color)
544 {
545 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
546
547 return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI d3drm_texture3_GetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE *width, D3DVALUE *height)
551 {
552 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
553
554 return E_NOTIMPL;
555 }
556
557 static HRESULT WINAPI d3drm_texture3_GetDecalOrigin(IDirect3DRMTexture3 *iface, LONG *x, LONG *y)
558 {
559 FIXME("iface %p, x %p, y %p stub!\n", iface, x, y);
560
561 return E_NOTIMPL;
562 }
563
564 static D3DRMIMAGE * WINAPI d3drm_texture3_GetImage(IDirect3DRMTexture3 *iface)
565 {
566 FIXME("iface %p stub!\n", iface);
567
568 return NULL;
569 }
570
571 static DWORD WINAPI d3drm_texture3_GetShades(IDirect3DRMTexture3 *iface)
572 {
573 FIXME("iface %p stub!\n", iface);
574
575 return 0;
576 }
577
578 static DWORD WINAPI d3drm_texture3_GetColors(IDirect3DRMTexture3 *iface)
579 {
580 FIXME("iface %p stub!\n", iface);
581
582 return 0;
583 }
584
585 static DWORD WINAPI d3drm_texture3_GetDecalScale(IDirect3DRMTexture3 *iface)
586 {
587 FIXME("iface %p stub!\n", iface);
588
589 return 0;
590 }
591
592 static BOOL WINAPI d3drm_texture3_GetDecalTransparency(IDirect3DRMTexture3 *iface)
593 {
594 FIXME("iface %p stub!\n", iface);
595
596 return FALSE;
597 }
598
599 static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor(IDirect3DRMTexture3 *iface)
600 {
601 FIXME("iface %p stub!\n", iface);
602
603 return 0;
604 }
605
606 static HRESULT WINAPI d3drm_texture3_InitFromImage(IDirect3DRMTexture3 *iface, D3DRMIMAGE *image)
607 {
608 FIXME("iface %p, image %p stub!\n", iface, image);
609
610 return E_NOTIMPL;
611 }
612
613 static HRESULT WINAPI d3drm_texture3_InitFromResource2(IDirect3DRMTexture3 *iface,
614 HMODULE module, const char *name, const char *type)
615 {
616 FIXME("iface %p, module %p, name %s, type %s stub!\n",
617 iface, module, debugstr_a(name), debugstr_a(type));
618
619 return E_NOTIMPL;
620 }
621
622 static HRESULT WINAPI d3drm_texture3_GenerateMIPMap(IDirect3DRMTexture3 *iface, DWORD flags)
623 {
624 FIXME("iface %p, flags %#x stub!\n", iface, flags);
625
626 return E_NOTIMPL;
627 }
628
629 static HRESULT WINAPI d3drm_texture3_GetSurface(IDirect3DRMTexture3 *iface,
630 DWORD flags, IDirectDrawSurface **surface)
631 {
632 FIXME("iface %p, flags %#x, surface %p stub!\n", iface, flags, surface);
633
634 return E_NOTIMPL;
635 }
636
637 static HRESULT WINAPI d3drm_texture3_SetCacheOptions(IDirect3DRMTexture3 *iface, LONG importance, DWORD flags)
638 {
639 FIXME("iface %p, importance %d, flags %#x stub!\n", iface, importance, flags);
640
641 return E_NOTIMPL;
642 }
643
644 static HRESULT WINAPI d3drm_texture3_GetCacheOptions(IDirect3DRMTexture3 *iface,
645 LONG *importance, DWORD *flags)
646 {
647 FIXME("iface %p, importance %p, flags %p stub!\n", iface, importance, flags);
648
649 return E_NOTIMPL;
650 }
651
652 static HRESULT WINAPI d3drm_texture3_SetDownsampleCallback(IDirect3DRMTexture3 *iface,
653 D3DRMDOWNSAMPLECALLBACK cb, void *ctx)
654 {
655 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
656
657 return E_NOTIMPL;
658 }
659
660 static HRESULT WINAPI d3drm_texture3_SetValidationCallback(IDirect3DRMTexture3 *iface,
661 D3DRMVALIDATIONCALLBACK cb, void *ctx)
662 {
663 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
664
665 return E_NOTIMPL;
666 }
667
668 static const struct IDirect3DRMTexture3Vtbl d3drm_texture3_vtbl =
669 {
670 d3drm_texture3_QueryInterface,
671 d3drm_texture3_AddRef,
672 d3drm_texture3_Release,
673 d3drm_texture3_Clone,
674 d3drm_texture3_AddDestroyCallback,
675 d3drm_texture3_DeleteDestroyCallback,
676 d3drm_texture3_SetAppData,
677 d3drm_texture3_GetAppData,
678 d3drm_texture3_SetName,
679 d3drm_texture3_GetName,
680 d3drm_texture3_GetClassName,
681 d3drm_texture3_InitFromFile,
682 d3drm_texture3_InitFromSurface,
683 d3drm_texture3_InitFromResource,
684 d3drm_texture3_Changed,
685 d3drm_texture3_SetColors,
686 d3drm_texture3_SetShades,
687 d3drm_texture3_SetDecalSize,
688 d3drm_texture3_SetDecalOrigin,
689 d3drm_texture3_SetDecalScale,
690 d3drm_texture3_SetDecalTransparency,
691 d3drm_texture3_SetDecalTransparentColor,
692 d3drm_texture3_GetDecalSize,
693 d3drm_texture3_GetDecalOrigin,
694 d3drm_texture3_GetImage,
695 d3drm_texture3_GetShades,
696 d3drm_texture3_GetColors,
697 d3drm_texture3_GetDecalScale,
698 d3drm_texture3_GetDecalTransparency,
699 d3drm_texture3_GetDecalTransparentColor,
700 d3drm_texture3_InitFromImage,
701 d3drm_texture3_InitFromResource2,
702 d3drm_texture3_GenerateMIPMap,
703 d3drm_texture3_GetSurface,
704 d3drm_texture3_SetCacheOptions,
705 d3drm_texture3_GetCacheOptions,
706 d3drm_texture3_SetDownsampleCallback,
707 d3drm_texture3_SetValidationCallback,
708 };
709
710 HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown **out)
711 {
712 struct d3drm_texture *object;
713
714 TRACE("riid %s, out %p.\n", debugstr_guid(riid), out);
715
716 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
717 return E_OUTOFMEMORY;
718
719 object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl;
720 object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl;
721 object->ref = 1;
722
723 if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
724 *out = (IUnknown *)&object->IDirect3DRMTexture3_iface;
725 else
726 *out = (IUnknown *)&object->IDirect3DRMTexture2_iface;
727
728 return S_OK;
729 }