xref: /reactos/dll/directx/wine/d3drm/face.c (revision 431643b9)
1 /*
2  * Implementation of IDirect3DRMFace Interface
3  *
4  * Copyright 2013 André Hentschel
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 "config.h"
22 #include "wine/port.h"
23 
24 #include "d3drm_private.h"
25 
26 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
27 
28 static inline struct d3drm_face *impl_from_IDirect3DRMFace(IDirect3DRMFace *iface)
29 {
30     return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace_iface);
31 }
32 
33 static inline struct d3drm_face *impl_from_IDirect3DRMFace2(IDirect3DRMFace2 *iface)
34 {
35     return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace2_iface);
36 }
37 
38 static HRESULT WINAPI d3drm_face1_QueryInterface(IDirect3DRMFace *iface, REFIID riid, void **out)
39 {
40     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
41 
42     TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
43 
44     if (IsEqualGUID(riid, &IID_IDirect3DRMFace)
45             || IsEqualGUID(riid, &IID_IDirect3DRMObject)
46             || IsEqualGUID(riid, &IID_IUnknown))
47     {
48         *out = &face->IDirect3DRMFace_iface;
49     }
50     else if(IsEqualGUID(riid, &IID_IDirect3DRMFace2))
51     {
52         *out = &face->IDirect3DRMFace2_iface;
53     }
54     else
55     {
56         *out = NULL;
57         WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
58         return E_NOINTERFACE;
59     }
60 
61     IUnknown_AddRef((IUnknown *)*out);
62     return S_OK;
63 }
64 
65 static ULONG WINAPI d3drm_face1_AddRef(IDirect3DRMFace *iface)
66 {
67     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
68     ULONG refcount = InterlockedIncrement(&face->ref);
69 
70     TRACE("%p increasing refcount to %u.\n", iface, refcount);
71 
72     return refcount;
73 }
74 
75 static ULONG WINAPI d3drm_face1_Release(IDirect3DRMFace *iface)
76 {
77     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
78     ULONG refcount = InterlockedDecrement(&face->ref);
79 
80     TRACE("%p decreasing refcount to %u.\n", iface, refcount);
81 
82     if (!refcount)
83     {
84         d3drm_object_cleanup((IDirect3DRMObject *)iface, &face->obj);
85         heap_free(face);
86     }
87 
88     return refcount;
89 }
90 
91 static HRESULT WINAPI d3drm_face1_Clone(IDirect3DRMFace *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_face1_AddDestroyCallback(IDirect3DRMFace *iface,
100         D3DRMOBJECTCALLBACK cb, void *ctx)
101 {
102     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
103 
104     TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
105 
106     return IDirect3DRMFace2_AddDestroyCallback(&face->IDirect3DRMFace2_iface, cb, ctx);
107 }
108 
109 static HRESULT WINAPI d3drm_face1_DeleteDestroyCallback(IDirect3DRMFace *iface,
110         D3DRMOBJECTCALLBACK cb, void *ctx)
111 {
112     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
113 
114     TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
115 
116     return IDirect3DRMFace2_DeleteDestroyCallback(&face->IDirect3DRMFace2_iface, cb, ctx);
117 }
118 
119 static HRESULT WINAPI d3drm_face2_SetAppData(IDirect3DRMFace2 *iface, DWORD data)
120 {
121     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
122 
123     TRACE("iface %p, data %#x.\n", iface, data);
124 
125     face->obj.appdata = data;
126 
127     return D3DRM_OK;
128 }
129 
130 static HRESULT WINAPI d3drm_face1_SetAppData(IDirect3DRMFace *iface, DWORD data)
131 {
132     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
133 
134     TRACE("iface %p, data %#x.\n", iface, data);
135 
136     return d3drm_face2_SetAppData(&face->IDirect3DRMFace2_iface, data);
137 }
138 
139 static DWORD WINAPI d3drm_face2_GetAppData(IDirect3DRMFace2 *iface)
140 {
141     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
142 
143     TRACE("iface %p.\n", iface);
144 
145     return face->obj.appdata;
146 }
147 
148 static DWORD WINAPI d3drm_face1_GetAppData(IDirect3DRMFace *iface)
149 {
150     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
151 
152     TRACE("iface %p.\n", iface);
153 
154     return d3drm_face2_GetAppData(&face->IDirect3DRMFace2_iface);
155 }
156 
157 static HRESULT WINAPI d3drm_face2_SetName(IDirect3DRMFace2 *iface, const char *name)
158 {
159     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
160 
161     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
162 
163     return d3drm_object_set_name(&face->obj, name);
164 }
165 
166 static HRESULT WINAPI d3drm_face1_SetName(IDirect3DRMFace *iface, const char *name)
167 {
168     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
169 
170     TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
171 
172     return d3drm_face2_SetName(&face->IDirect3DRMFace2_iface, name);
173 }
174 
175 static HRESULT WINAPI d3drm_face2_GetName(IDirect3DRMFace2 *iface, DWORD *size, char *name)
176 {
177     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
178 
179     TRACE("iface %p, size %p, name %p.\n", iface, size, name);
180 
181     return d3drm_object_get_name(&face->obj, size, name);
182 }
183 
184 static HRESULT WINAPI d3drm_face1_GetName(IDirect3DRMFace *iface, DWORD *size, char *name)
185 {
186     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
187 
188     TRACE("iface %p, size %p, name %p.\n", iface, size, name);
189 
190     return d3drm_face2_GetName(&face->IDirect3DRMFace2_iface, size, name);
191 }
192 
193 static HRESULT WINAPI d3drm_face1_GetClassName(IDirect3DRMFace *iface, DWORD *size, char *name)
194 {
195     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
196 
197     TRACE("iface %p, size %p, name %p.\n", iface, size, name);
198 
199     return IDirect3DRMFace2_GetClassName(&face->IDirect3DRMFace2_iface, size, name);
200 }
201 
202 static HRESULT WINAPI d3drm_face1_AddVertex(IDirect3DRMFace *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
203 {
204     FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z);
205 
206     return E_NOTIMPL;
207 }
208 
209 static HRESULT WINAPI d3drm_face1_AddVertexAndNormalIndexed(IDirect3DRMFace *iface,
210         DWORD vertex, DWORD normal)
211 {
212     FIXME("iface %p, vertex %u, normal %u stub!\n", iface, vertex, normal);
213 
214     return E_NOTIMPL;
215 }
216 
217 static HRESULT WINAPI d3drm_face2_SetColorRGB(IDirect3DRMFace2 *iface, D3DVALUE red, D3DVALUE green, D3DVALUE blue)
218 {
219     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
220 
221     TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
222 
223     d3drm_set_color(&face->color, red, green, blue, 1.0f);
224 
225     return D3DRM_OK;
226 }
227 
228 static HRESULT WINAPI d3drm_face1_SetColorRGB(IDirect3DRMFace *iface,
229         D3DVALUE red, D3DVALUE green, D3DVALUE blue)
230 {
231     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
232 
233     TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
234 
235     return d3drm_face2_SetColorRGB(&face->IDirect3DRMFace2_iface, red, green, blue);
236 }
237 
238 static HRESULT WINAPI d3drm_face2_SetColor(IDirect3DRMFace2 *iface, D3DCOLOR color)
239 {
240     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
241 
242     TRACE("iface %p, color 0x%08x.\n", iface, color);
243 
244     face->color = color;
245 
246     return D3DRM_OK;
247 }
248 
249 static HRESULT WINAPI d3drm_face1_SetColor(IDirect3DRMFace *iface, D3DCOLOR color)
250 {
251     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
252 
253     TRACE("iface %p, color 0x%08x.\n", iface, color);
254 
255     return d3drm_face2_SetColor(&face->IDirect3DRMFace2_iface, color);
256 }
257 
258 static HRESULT WINAPI d3drm_face1_SetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture *texture)
259 {
260     FIXME("iface %p, texture %p stub!\n", iface, texture);
261 
262     return E_NOTIMPL;
263 }
264 
265 static HRESULT WINAPI d3drm_face1_SetTextureCoordinates(IDirect3DRMFace *iface,
266         DWORD vertex, D3DVALUE u, D3DVALUE v)
267 {
268     FIXME("iface %p, vertex %u, u %.8e, v %.8e stub!\n", iface, vertex, u, v);
269 
270     return E_NOTIMPL;
271 }
272 
273 static HRESULT WINAPI d3drm_face1_SetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial *material)
274 {
275     FIXME("iface %p, material %p stub!\n", iface, material);
276 
277     return E_NOTIMPL;
278 }
279 
280 static HRESULT WINAPI d3drm_face1_SetTextureTopology(IDirect3DRMFace *iface, BOOL wrap_u, BOOL wrap_v)
281 {
282     FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
283 
284     return E_NOTIMPL;
285 }
286 
287 static HRESULT WINAPI d3drm_face1_GetVertex(IDirect3DRMFace *iface,
288         DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal)
289 {
290     FIXME("iface %p, index %u, vertex %p, normal %p stub!\n", iface, index, vertex, normal);
291 
292     return E_NOTIMPL;
293 }
294 
295 static HRESULT WINAPI d3drm_face1_GetVertices(IDirect3DRMFace *iface,
296         DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals)
297 {
298     FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n",
299             iface, vertex_count, coords, normals);
300 
301     return E_NOTIMPL;
302 }
303 
304 static HRESULT WINAPI d3drm_face1_GetTextureCoordinates(IDirect3DRMFace *iface,
305         DWORD vertex, D3DVALUE *u, D3DVALUE *v)
306 {
307     FIXME("iface %p, vertex %u, u %p, v %p stub!\n", iface, vertex, u, v);
308 
309     return E_NOTIMPL;
310 }
311 
312 static HRESULT WINAPI d3drm_face1_GetTextureTopology(IDirect3DRMFace *iface, BOOL *wrap_u, BOOL *wrap_v)
313 {
314     FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
315 
316     return E_NOTIMPL;
317 }
318 
319 static HRESULT WINAPI d3drm_face1_GetNormal(IDirect3DRMFace *iface, D3DVECTOR *normal)
320 {
321     FIXME("iface %p, normal %p stub!\n", iface, normal);
322 
323     return E_NOTIMPL;
324 }
325 
326 static HRESULT WINAPI d3drm_face1_GetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture **texture)
327 {
328     FIXME("iface %p, texture %p stub!\n", iface, texture);
329 
330     return E_NOTIMPL;
331 }
332 
333 static HRESULT WINAPI d3drm_face1_GetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial **material)
334 {
335     FIXME("iface %p, material %p stub!\n", iface, material);
336 
337     return E_NOTIMPL;
338 }
339 
340 static int WINAPI d3drm_face1_GetVertexCount(IDirect3DRMFace *iface)
341 {
342     FIXME("iface %p stub!\n", iface);
343 
344     return 0;
345 }
346 
347 static int WINAPI d3drm_face1_GetVertexIndex(IDirect3DRMFace *iface, DWORD which)
348 {
349     FIXME("iface %p, which %u stub!\n", iface, which);
350 
351     return 0;
352 }
353 
354 static int WINAPI d3drm_face1_GetTextureCoordinateIndex(IDirect3DRMFace *iface, DWORD which)
355 {
356     FIXME("iface %p, which %u stub!\n", iface, which);
357 
358     return 0;
359 }
360 
361 static D3DCOLOR WINAPI d3drm_face2_GetColor(IDirect3DRMFace2 *iface)
362 {
363     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
364 
365     TRACE("iface %p.\n", iface);
366 
367     return face->color;
368 }
369 
370 static D3DCOLOR WINAPI d3drm_face1_GetColor(IDirect3DRMFace *iface)
371 {
372     struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
373 
374     TRACE("iface %p.\n", iface);
375 
376     return d3drm_face2_GetColor(&face->IDirect3DRMFace2_iface);
377 }
378 
379 static const struct IDirect3DRMFaceVtbl d3drm_face1_vtbl =
380 {
381     d3drm_face1_QueryInterface,
382     d3drm_face1_AddRef,
383     d3drm_face1_Release,
384     d3drm_face1_Clone,
385     d3drm_face1_AddDestroyCallback,
386     d3drm_face1_DeleteDestroyCallback,
387     d3drm_face1_SetAppData,
388     d3drm_face1_GetAppData,
389     d3drm_face1_SetName,
390     d3drm_face1_GetName,
391     d3drm_face1_GetClassName,
392     d3drm_face1_AddVertex,
393     d3drm_face1_AddVertexAndNormalIndexed,
394     d3drm_face1_SetColorRGB,
395     d3drm_face1_SetColor,
396     d3drm_face1_SetTexture,
397     d3drm_face1_SetTextureCoordinates,
398     d3drm_face1_SetMaterial,
399     d3drm_face1_SetTextureTopology,
400     d3drm_face1_GetVertex,
401     d3drm_face1_GetVertices,
402     d3drm_face1_GetTextureCoordinates,
403     d3drm_face1_GetTextureTopology,
404     d3drm_face1_GetNormal,
405     d3drm_face1_GetTexture,
406     d3drm_face1_GetMaterial,
407     d3drm_face1_GetVertexCount,
408     d3drm_face1_GetVertexIndex,
409     d3drm_face1_GetTextureCoordinateIndex,
410     d3drm_face1_GetColor,
411 };
412 
413 static HRESULT WINAPI d3drm_face2_QueryInterface(IDirect3DRMFace2 *iface, REFIID riid, void **out)
414 {
415     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
416 
417     return d3drm_face1_QueryInterface(&face->IDirect3DRMFace_iface, riid, out);
418 }
419 
420 static ULONG WINAPI d3drm_face2_AddRef(IDirect3DRMFace2 *iface)
421 {
422     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
423 
424     return d3drm_face1_AddRef(&face->IDirect3DRMFace_iface);
425 }
426 
427 static ULONG WINAPI d3drm_face2_Release(IDirect3DRMFace2 *iface)
428 {
429     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
430 
431     return d3drm_face1_Release(&face->IDirect3DRMFace_iface);
432 }
433 
434 static HRESULT WINAPI d3drm_face2_Clone(IDirect3DRMFace2 *iface,
435         IUnknown *outer, REFIID iid, void **out)
436 {
437     FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
438 
439     return E_NOTIMPL;
440 }
441 
442 static HRESULT WINAPI d3drm_face2_AddDestroyCallback(IDirect3DRMFace2 *iface,
443         D3DRMOBJECTCALLBACK cb, void *ctx)
444 {
445     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
446 
447     TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
448 
449     return d3drm_object_add_destroy_callback(&face->obj, cb, ctx);
450 }
451 
452 static HRESULT WINAPI d3drm_face2_DeleteDestroyCallback(IDirect3DRMFace2 *iface,
453         D3DRMOBJECTCALLBACK cb, void *ctx)
454 {
455     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
456 
457     TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
458 
459     return d3drm_object_delete_destroy_callback(&face->obj, cb, ctx);
460 }
461 
462 static HRESULT WINAPI d3drm_face2_GetClassName(IDirect3DRMFace2 *iface, DWORD *size, char *name)
463 {
464     struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
465 
466     TRACE("iface %p, size %p, name %p.\n", iface, size, name);
467 
468     return d3drm_object_get_class_name(&face->obj, size, name);
469 }
470 
471 static HRESULT WINAPI d3drm_face2_AddVertex(IDirect3DRMFace2 *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
472 {
473     FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z);
474 
475     return E_NOTIMPL;
476 }
477 
478 static HRESULT WINAPI d3drm_face2_AddVertexAndNormalIndexed(IDirect3DRMFace2 *iface,
479         DWORD vertex, DWORD normal)
480 {
481     FIXME("iface %p, vertex %u, normal %u stub!\n", iface, vertex, normal);
482 
483     return E_NOTIMPL;
484 }
485 
486 static HRESULT WINAPI d3drm_face2_SetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 *texture)
487 {
488     FIXME("iface %p, texture %p stub!\n", iface, texture);
489 
490     return E_NOTIMPL;
491 }
492 
493 static HRESULT WINAPI d3drm_face2_SetTextureCoordinates(IDirect3DRMFace2 *iface,
494         DWORD vertex, D3DVALUE u, D3DVALUE v)
495 {
496     FIXME("iface %p, vertex %u, u %.8e, v %.8e stub!\n", iface, vertex, u, v);
497 
498     return E_NOTIMPL;
499 }
500 
501 static HRESULT WINAPI d3drm_face2_SetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 *material)
502 {
503     FIXME("iface %p, material %p stub!\n", iface, material);
504 
505     return E_NOTIMPL;
506 }
507 
508 static HRESULT WINAPI d3drm_face2_SetTextureTopology(IDirect3DRMFace2 *iface, BOOL wrap_u, BOOL wrap_v)
509 {
510     FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
511 
512     return E_NOTIMPL;
513 }
514 
515 static HRESULT WINAPI d3drm_face2_GetVertex(IDirect3DRMFace2 *iface,
516         DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal)
517 {
518     FIXME("iface %p, index %u, vertex %p, normal %p stub!\n", iface, index, vertex, normal);
519 
520     return E_NOTIMPL;
521 }
522 
523 static HRESULT WINAPI d3drm_face2_GetVertices(IDirect3DRMFace2 *iface,
524         DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals)
525 {
526     FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n",
527             iface, vertex_count, coords, normals);
528 
529     return E_NOTIMPL;
530 }
531 
532 static HRESULT WINAPI d3drm_face2_GetTextureCoordinates(IDirect3DRMFace2 *iface,
533         DWORD vertex, D3DVALUE *u, D3DVALUE *v)
534 {
535     FIXME("iface %p, vertex %u, u %p, v %p stub!\n", iface, vertex, u, v);
536 
537     return E_NOTIMPL;
538 }
539 
540 static HRESULT WINAPI d3drm_face2_GetTextureTopology(IDirect3DRMFace2 *iface, BOOL *wrap_u, BOOL *wrap_v)
541 {
542     FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
543 
544     return E_NOTIMPL;
545 }
546 
547 static HRESULT WINAPI d3drm_face2_GetNormal(IDirect3DRMFace2 *iface, D3DVECTOR *normal)
548 {
549     FIXME("iface %p, normal %p stub!\n", iface, normal);
550 
551     return E_NOTIMPL;
552 }
553 
554 static HRESULT WINAPI d3drm_face2_GetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 **texture)
555 {
556     FIXME("iface %p, texture %p stub!\n", iface, texture);
557 
558     return E_NOTIMPL;
559 }
560 
561 static HRESULT WINAPI d3drm_face2_GetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 **material)
562 {
563     FIXME("iface %p, material %p stub!\n", iface, material);
564 
565     return E_NOTIMPL;
566 }
567 
568 static int WINAPI d3drm_face2_GetVertexCount(IDirect3DRMFace2 *iface)
569 {
570     FIXME("iface %p stub!\n", iface);
571 
572     return 0;
573 }
574 
575 static int WINAPI d3drm_face2_GetVertexIndex(IDirect3DRMFace2 *iface, DWORD which)
576 {
577     FIXME("iface %p, which %u stub!\n", iface, which);
578 
579     return 0;
580 }
581 
582 static int WINAPI d3drm_face2_GetTextureCoordinateIndex(IDirect3DRMFace2 *iface, DWORD which)
583 {
584     FIXME("iface %p, which %u stub!\n", iface, which);
585 
586     return 0;
587 }
588 
589 static const struct IDirect3DRMFace2Vtbl d3drm_face2_vtbl =
590 {
591     d3drm_face2_QueryInterface,
592     d3drm_face2_AddRef,
593     d3drm_face2_Release,
594     d3drm_face2_Clone,
595     d3drm_face2_AddDestroyCallback,
596     d3drm_face2_DeleteDestroyCallback,
597     d3drm_face2_SetAppData,
598     d3drm_face2_GetAppData,
599     d3drm_face2_SetName,
600     d3drm_face2_GetName,
601     d3drm_face2_GetClassName,
602     d3drm_face2_AddVertex,
603     d3drm_face2_AddVertexAndNormalIndexed,
604     d3drm_face2_SetColorRGB,
605     d3drm_face2_SetColor,
606     d3drm_face2_SetTexture,
607     d3drm_face2_SetTextureCoordinates,
608     d3drm_face2_SetMaterial,
609     d3drm_face2_SetTextureTopology,
610     d3drm_face2_GetVertex,
611     d3drm_face2_GetVertices,
612     d3drm_face2_GetTextureCoordinates,
613     d3drm_face2_GetTextureTopology,
614     d3drm_face2_GetNormal,
615     d3drm_face2_GetTexture,
616     d3drm_face2_GetMaterial,
617     d3drm_face2_GetVertexCount,
618     d3drm_face2_GetVertexIndex,
619     d3drm_face2_GetTextureCoordinateIndex,
620     d3drm_face2_GetColor,
621 };
622 
623 HRESULT d3drm_face_create(struct d3drm_face **face)
624 {
625     static const char classname[] = "Face";
626     struct d3drm_face *object;
627 
628     TRACE("face %p.\n", face);
629 
630     if (!(object = heap_alloc_zero(sizeof(*object))))
631         return E_OUTOFMEMORY;
632 
633     object->IDirect3DRMFace_iface.lpVtbl = &d3drm_face1_vtbl;
634     object->IDirect3DRMFace2_iface.lpVtbl = &d3drm_face2_vtbl;
635     object->ref = 1;
636 
637     d3drm_object_init(&object->obj, classname);
638 
639     *face = object;
640 
641     return S_OK;
642 }
643