ddraw: Use EnumAttachedSurfaces to search for a render target.
[wine] / dlls / ddraw / vertexbuffer.c
1 /* Direct3D Vertex Buffer
2  * Copyright (c) 2002 Lionel ULMER
3  * Copyright (c) 2006 Stefan DÖSINGER
4  *
5  * This file contains the implementation of Direct3DVertexBuffer COM object
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #include "config.h"
23 #include "wine/port.h"
24 #include "wine/debug.h"
25
26 #include <assert.h>
27 #include <stdarg.h>
28 #include <string.h>
29 #include <stdlib.h>
30
31 #define COBJMACROS
32
33 #include "windef.h"
34 #include "winbase.h"
35 #include "winnls.h"
36 #include "winerror.h"
37 #include "wingdi.h"
38 #include "wine/exception.h"
39 #include "excpt.h"
40
41 #include "ddraw.h"
42 #include "d3d.h"
43
44 #include "ddraw_private.h"
45
46 WINE_DEFAULT_DEBUG_CHANNEL(d3d7);
47 WINE_DECLARE_DEBUG_CHANNEL(ddraw_thunk);
48
49
50 /*****************************************************************************
51  * IUnknown Methods
52  *****************************************************************************/
53
54 /*****************************************************************************
55  * IDirect3DVertexBuffer7::QueryInterface
56  *
57  * The QueryInterface Method for Vertex Buffers
58  * For a link to QueryInterface rules, see IDirectDraw7::QueryInterface
59  *
60  * Params
61  *  riid: Queryied Interface id
62  *  obj: Address to return the interface pointer
63  *
64  * Returns:
65  *  S_OK on success
66  *  E_NOINTERFACE if the interface wasn't found
67  *
68  *****************************************************************************/
69 static HRESULT WINAPI
70 IDirect3DVertexBufferImpl_QueryInterface(IDirect3DVertexBuffer7 *iface,
71                                          REFIID riid,
72                                          void  **obj)
73 {
74     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
75     TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), obj);
76
77     /* By default, set the object pointer to NULL */
78     *obj = NULL;
79
80     if ( IsEqualGUID( &IID_IUnknown,  riid ) )
81     {
82         IDirect3DVertexBuffer7_AddRef(ICOM_INTERFACE(This,IDirect3DVertexBuffer7));
83         *obj = iface;
84         TRACE("  Creating IUnknown interface at %p.\n", *obj);
85         return S_OK;
86     }
87     if ( IsEqualGUID( &IID_IDirect3DVertexBuffer, riid ) )
88     {
89         IDirect3DVertexBuffer7_AddRef(ICOM_INTERFACE(This,IDirect3DVertexBuffer7));
90         *obj = ICOM_INTERFACE(This, IDirect3DVertexBuffer);
91         TRACE("  Creating IDirect3DVertexBuffer interface %p\n", *obj);
92         return S_OK;
93     }
94     if ( IsEqualGUID( &IID_IDirect3DVertexBuffer7, riid ) )
95     {
96         IDirect3DVertexBuffer7_AddRef(ICOM_INTERFACE(This,IDirect3DVertexBuffer7));
97         *obj = ICOM_INTERFACE(This, IDirect3DVertexBuffer7);
98         TRACE("  Creating IDirect3DVertexBuffer7 interface %p\n", *obj);
99         return S_OK;
100     }
101     FIXME("(%p): interface for IID %s NOT found!\n", This, debugstr_guid(riid));
102     return E_NOINTERFACE;
103 }
104
105 static HRESULT WINAPI
106 Thunk_IDirect3DVertexBufferImpl_1_QueryInterface(IDirect3DVertexBuffer *iface,
107                                                  REFIID riid,
108                                                  void **obj)
109 {
110     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
111     TRACE_(ddraw_thunk)("(%p)->(%s,%p) thunking to IDirect3DVertexBuffer7 interface.\n", This, debugstr_guid(riid), obj);
112
113     return IDirect3DVertexBuffer7_QueryInterface(ICOM_INTERFACE(This, IDirect3DVertexBuffer7),
114                                                  riid,
115                                                  obj);
116 }
117
118 /*****************************************************************************
119  * IDirect3DVertexBuffer7::AddRef
120  *
121  * AddRef for Vertex Buffers
122  *
123  * Returns:
124  *  The new refcount
125  *
126  *****************************************************************************/
127 static ULONG WINAPI
128 IDirect3DVertexBufferImpl_AddRef(IDirect3DVertexBuffer7 *iface)
129 {
130     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
131     ULONG ref = InterlockedIncrement(&This->ref);
132
133     TRACE("(%p/%p)->() incrementing from %u.\n", This, iface, ref - 1);
134
135     return ref;
136 }
137
138 static ULONG WINAPI
139 Thunk_IDirect3DVertexBufferImpl_1_AddRef(IDirect3DVertexBuffer *iface)
140 {
141     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
142     TRACE_(ddraw_thunk)("(%p)->() thunking to IDirect3DVertexBuffer7 interface.\n", This);
143
144     return IDirect3DVertexBuffer7_AddRef(ICOM_INTERFACE(This, IDirect3DVertexBuffer7));
145 }
146
147
148 /*****************************************************************************
149  * IDirect3DVertexBuffer7::Release
150  *
151  * Release for Vertex Buffers
152  *
153  * Returns:
154  *  The new refcount
155  *
156  *****************************************************************************/
157 static ULONG WINAPI
158 IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface)
159 {
160     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
161     ULONG ref = InterlockedDecrement(&This->ref);
162
163     TRACE("(%p)->() decrementing from %u.\n", This, ref + 1);
164
165     if (ref == 0)
166     {
167         IWineD3DVertexBuffer *curVB = NULL;
168         UINT offset, stride;
169
170         /* D3D7 Vertex buffers don't stay bound in the device, they are passed as a parameter
171          * to drawPrimitiveVB. DrawPrimitiveVB sets them as the stream source in wined3d,
172          * and they should get unset there before they are destroyed
173          */
174         IWineD3DDevice_GetStreamSource(This->ddraw->wineD3DDevice,
175                                        0 /* Stream number */,
176                                        &curVB,
177                                        &offset,
178                                        &stride);
179         if(curVB == This->wineD3DVertexBuffer)
180         {
181             IWineD3DDevice_SetStreamSource(This->ddraw->wineD3DDevice,
182                                         0 /* Steam number */,
183                                         NULL /* stream data */,
184                                         0 /* Offset */,
185                                         0 /* stride */);
186         }
187         if(curVB)
188         {
189             IWineD3DVertexBuffer_Release(curVB); /* For the GetStreamSource */
190         }
191
192         IWineD3DVertexDeclaration_Release(This->wineD3DVertexDeclaration);
193         IWineD3DVertexBuffer_Release(This->wineD3DVertexBuffer);
194         HeapFree(GetProcessHeap(), 0, This);
195         return 0;
196     }
197     return ref;
198 }
199
200 static ULONG WINAPI
201 Thunk_IDirect3DVertexBufferImpl_1_Release(IDirect3DVertexBuffer *iface)
202 {
203     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
204     TRACE_(ddraw_thunk)("(%p)->() thunking to IDirect3DVertexBuffer7 interface.\n", This);
205
206     return IDirect3DVertexBuffer7_Release(ICOM_INTERFACE(This, IDirect3DVertexBuffer7));
207 }
208
209 /*****************************************************************************
210  * IDirect3DVertexBuffer Methods
211  *****************************************************************************/
212
213 /*****************************************************************************
214  * IDirect3DVertexBuffer7::Lock
215  *
216  * Locks the vertex buffer and returns a pointer to the vertex data
217  * Locking vertex buffers is similar to locking surfaces, because Windows
218  * uses surfaces to store vertex data internally (According to the DX sdk)
219  *
220  * Params:
221  *  Flags: Locking flags. Relevant here are DDLOCK_READONLY, DDLOCK_WRITEONLY,
222  *         DDLOCK_DISCARDCONTENTS and DDLOCK_NOOVERWRITE.
223  *  Data:  Returns a pointer to the vertex data
224  *  Size:  Returns the size of the buffer if not NULL
225  *
226  * Returns:
227  *  D3D_OK on success
228  *  DDERR_INVALIDPARAMS if Data is NULL
229  *  D3DERR_VERTEXBUFFEROPTIMIZED if called on an optimized buffer(WineD3D)
230  *
231  *****************************************************************************/
232 static HRESULT WINAPI
233 IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface,
234                                DWORD Flags,
235                                void **Data,
236                                DWORD *Size)
237 {
238     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
239     WINED3DVERTEXBUFFER_DESC Desc;
240     HRESULT hr;
241     TRACE("(%p)->(%08x,%p,%p)\n", This, Flags, Data, Size);
242
243     if(Size)
244     {
245         /* Get the size, for returning it, and for locking */
246         hr = IWineD3DVertexBuffer_GetDesc(This->wineD3DVertexBuffer,
247                                           &Desc);
248         if(hr != D3D_OK)
249         {
250             ERR("(%p) IWineD3DVertexBuffer::GetDesc failed with hr=%08x\n", This, hr);
251             return hr;
252         }
253         *Size = Desc.Size;
254     }
255
256     return IWineD3DVertexBuffer_Lock(This->wineD3DVertexBuffer,
257                                      0 /* OffsetToLock */,
258                                      0 /* SizeToLock, 0 == Full lock */,
259                                      (BYTE **) Data,
260                                      Flags);
261 }
262
263 static HRESULT WINAPI
264 Thunk_IDirect3DVertexBufferImpl_1_Lock(IDirect3DVertexBuffer *iface,
265                                        DWORD Flags,
266                                        void **Data,
267                                        DWORD *Size)
268 {
269     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
270     TRACE_(ddraw_thunk)("(%p)->(%08x,%p,%p) thunking to IDirect3DVertexBuffer7 interface.\n", This, Flags, Data, Size);
271
272     return IDirect3DVertexBuffer7_Lock(ICOM_INTERFACE(This, IDirect3DVertexBuffer7),
273                                        Flags,
274                                        Data,
275                                        Size);
276 }
277
278 /*****************************************************************************
279  * IDirect3DVertexBuffer7::Unlock
280  *
281  * Unlocks a vertex Buffer
282  *
283  * Returns:
284  *  D3D_OK on success
285  *
286  *****************************************************************************/
287 static HRESULT WINAPI
288 IDirect3DVertexBufferImpl_Unlock(IDirect3DVertexBuffer7 *iface)
289 {
290     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
291     TRACE("(%p)->()\n", This);
292
293     /* This is easy :) */
294     return IWineD3DVertexBuffer_Unlock(This->wineD3DVertexBuffer);
295 }
296
297 static HRESULT WINAPI
298 Thunk_IDirect3DVertexBufferImpl_1_Unlock(IDirect3DVertexBuffer *iface)
299 {
300     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
301     TRACE_(ddraw_thunk)("(%p)->() thunking to IDirect3DVertexBuffer7 interface.\n", This);
302
303     return IDirect3DVertexBuffer7_Unlock(ICOM_INTERFACE(This, IDirect3DVertexBuffer7));
304 }
305
306
307 /*****************************************************************************
308  * IDirect3DVertexBuffer7::ProcessVertices
309  *
310  * Processes untransformed Vertices into a transformed or optimized vertex
311  * buffer. It can also perform other operations, such as lighting or clipping
312  *
313  * Params
314  *  VertexOp: Operation(s) to perform: D3DVOP_CLIP, _EXTENTS, _LIGHT, _TRANSFORM
315  *  DestIndex: Index in the destination buffer(This), where the vertices are
316  *             placed
317  *  Count: Number of Vertices in the Source buffer to process
318  *  SrcBuffer: Source vertex buffer
319  *  SrcIndex: Index of the first vertex in the src buffer to process
320  *  D3DDevice: Device to use for transformation
321  *  Flags: 0 for default, D3DPV_DONOTCOPYDATA to prevent copying
322  *         unchaned vertices
323  *
324  * Returns:
325  *  D3D_OK on success
326  *  DDERR_INVALIDPARAMS If D3DVOP_TRANSFORM wasn't passed
327  *
328  *****************************************************************************/
329 static HRESULT WINAPI
330 IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
331                                           DWORD VertexOp,
332                                           DWORD DestIndex,
333                                           DWORD Count,
334                                           IDirect3DVertexBuffer7 *SrcBuffer,
335                                           DWORD SrcIndex,
336                                           IDirect3DDevice7 *D3DDevice,
337                                           DWORD Flags)
338 {
339     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
340     IDirect3DVertexBufferImpl *Src = ICOM_OBJECT(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, SrcBuffer);
341     IDirect3DDeviceImpl *D3D = ICOM_OBJECT(IDirect3DDeviceImpl, IDirect3DDevice7, D3DDevice);
342     BOOL oldClip, doClip;
343     HRESULT hr;
344     WINED3DVERTEXBUFFER_DESC Desc;
345
346     TRACE("(%p)->(%08x,%d,%d,%p,%d,%p,%08x)\n", This, VertexOp, DestIndex, Count, Src, SrcIndex, D3D, Flags);
347
348     /* Vertex operations:
349      * D3DVOP_CLIP: Clips vertices outside the viewing frustrum. Needs clipping information
350      * in the vertex buffer (Buffer may not be created with D3DVBCAPS_DONOTCLIP)
351      * D3DVOP_EXTENTS: Causes the screen extents to be updated when rendering the vertices
352      * D3DVOP_LIGHT: Lights the vertices
353      * D3DVOP_TRANSFORM: Transform the vertices. This flag is necessary
354      *
355      * WineD3D only transforms and clips the vertices by now, so EXTENTS and LIGHT
356      * are not implemented. Clipping is disabled ATM, because of unsure conditions.
357      */
358     if( !(VertexOp & D3DVOP_TRANSFORM) ) return DDERR_INVALIDPARAMS;
359
360     /* WineD3D doesn't know d3d7 vertex operation, it uses
361      * render states instead. Set the render states according to
362      * the vertex ops
363      */
364     doClip = VertexOp & D3DVOP_CLIP ? TRUE : FALSE;
365     IWineD3DDevice_GetRenderState(D3D->wineD3DDevice,
366                                   WINED3DRS_CLIPPING,
367                                   (DWORD *) &oldClip);
368     if(doClip != oldClip)
369     {
370         IWineD3DDevice_SetRenderState(D3D->wineD3DDevice,
371                                       WINED3DRS_CLIPPING,
372                                       doClip);
373     }
374
375     IWineD3DVertexBuffer_GetDesc(Src->wineD3DVertexBuffer,
376                                  &Desc);
377     IWineD3DDevice_SetStreamSource(D3D->wineD3DDevice,
378                                    0, /* Stream No */
379                                    Src->wineD3DVertexBuffer,
380                                    0, /* Offset */
381                                    get_flexible_vertex_size(Desc.FVF));
382     IWineD3DDevice_SetVertexDeclaration(D3D->wineD3DDevice,
383                                         Src->wineD3DVertexDeclaration);
384     hr = IWineD3DDevice_ProcessVertices(D3D->wineD3DDevice,
385                                         SrcIndex,
386                                         DestIndex,
387                                         Count,
388                                         This->wineD3DVertexBuffer,
389                                         NULL /* Output vdecl */,
390                                         Flags);
391
392     /* Restore the states if needed */
393     if(doClip != oldClip)
394         IWineD3DDevice_SetRenderState(D3D->wineD3DDevice,
395                                       WINED3DRS_CLIPPING,
396                                       oldClip);
397     return hr;
398 }
399
400 static HRESULT WINAPI
401 Thunk_IDirect3DVertexBufferImpl_1_ProcessVertices(IDirect3DVertexBuffer *iface,
402                                                   DWORD VertexOp,
403                                                   DWORD DestIndex,
404                                                   DWORD Count,
405                                                   IDirect3DVertexBuffer *SrcBuffer,
406                                                   DWORD SrcIndex,
407                                                   IDirect3DDevice3 *D3DDevice,
408                                                   DWORD Flags)
409 {
410     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
411     IDirect3DVertexBufferImpl *Src = ICOM_OBJECT(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, SrcBuffer);
412     IDirect3DDeviceImpl *D3D = ICOM_OBJECT(IDirect3DDeviceImpl, IDirect3DDevice3, D3DDevice);
413
414     TRACE_(ddraw_thunk)("(%p)->(%08x,%08x,%08x,%p,%08x,%p,%08x) thunking to IDirect3DVertexBuffer7 interface.\n", This, VertexOp, DestIndex, Count, Src, SrcIndex, D3D, Flags);
415
416     return IDirect3DVertexBuffer7_ProcessVertices(ICOM_INTERFACE(This, IDirect3DVertexBuffer7),
417                                                   VertexOp,
418                                                   DestIndex,
419                                                   Count,
420                                                   ICOM_INTERFACE(Src, IDirect3DVertexBuffer7),
421                                                   SrcIndex,
422                                                   ICOM_INTERFACE(D3D, IDirect3DDevice7),
423                                                   Flags);
424 }
425
426 /*****************************************************************************
427  * IDirect3DVertexBuffer7::GetVertexBufferDesc
428  *
429  * Returns the description of a vertex buffer
430  *
431  * Params:
432  *  Desc: Address to write the description to
433  *
434  * Returns
435  *  DDERR_INVALIDPARAMS if Desc is NULL
436  *  D3D_OK on success
437  *
438  *****************************************************************************/
439 static HRESULT WINAPI
440 IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface,
441                                               D3DVERTEXBUFFERDESC *Desc)
442 {
443     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
444     WINED3DVERTEXBUFFER_DESC WDesc;
445     HRESULT hr;
446     DWORD size;
447     TRACE("(%p)->(%p)\n", This, Desc);
448
449     if(!Desc) return DDERR_INVALIDPARAMS;
450
451     hr = IWineD3DVertexBuffer_GetDesc(This->wineD3DVertexBuffer,
452                                       &WDesc);
453     if(hr != D3D_OK)
454     {
455         ERR("(%p) IWineD3DVertexBuffer::GetDesc failed with hr=%08x\n", This, hr);
456         return hr;
457     }
458
459     /* Clear the return value of garbage */
460     size = Desc->dwSize;
461     memset(Desc, 0, size);
462
463     /* Now fill the Desc structure */
464     Desc->dwSize = size;
465     Desc->dwCaps = This->Caps;
466     Desc->dwFVF = WDesc.FVF;
467     Desc->dwNumVertices = WDesc.Size / get_flexible_vertex_size(WDesc.FVF);
468
469     return D3D_OK;
470 }
471
472 static HRESULT WINAPI
473 Thunk_IDirect3DVertexBufferImpl_1_GetVertexBufferDesc(IDirect3DVertexBuffer *iface,
474                                                       D3DVERTEXBUFFERDESC *Desc)
475 {
476     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
477     TRACE_(ddraw_thunk)("(%p)->(%p) thunking to IDirect3DVertexBuffer7 interface.\n", This, Desc);
478
479     return IDirect3DVertexBuffer7_GetVertexBufferDesc(ICOM_INTERFACE(This, IDirect3DVertexBuffer7),
480                                                       Desc);
481 }
482
483
484 /*****************************************************************************
485  * IDirect3DVertexBuffer7::Optimize
486  *
487  * Converts an unoptimized vertex buffer into an optimized buffer
488  *
489  * Params:
490  *  D3DDevice: Device for which this buffer is optimized
491  *  Flags: Not used, should be set to 0
492  *
493  * Returns
494  *  D3D_OK, because it's a stub
495  *
496  *****************************************************************************/
497 static HRESULT WINAPI
498 IDirect3DVertexBufferImpl_Optimize(IDirect3DVertexBuffer7 *iface,
499                                    IDirect3DDevice7 *D3DDevice,
500                                    DWORD Flags)
501 {
502     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
503     IDirect3DDeviceImpl *D3D = ICOM_OBJECT(IDirect3DDeviceImpl, IDirect3DDevice7, D3DDevice);
504     FIXME("(%p)->(%p,%08x): stub!\n", This, D3D, Flags);
505
506     /* We could forward this call to WineD3D and take advantage
507      * of it once we use OpenGL vertex buffers
508      */
509     This->Caps |= D3DVBCAPS_OPTIMIZED;
510
511     return DD_OK;
512 }
513
514 static HRESULT WINAPI
515 Thunk_IDirect3DVertexBufferImpl_1_Optimize(IDirect3DVertexBuffer *iface,
516                                            IDirect3DDevice3 *D3DDevice,
517                                            DWORD Flags)
518 {
519     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, iface);
520     IDirect3DDeviceImpl *D3D = ICOM_OBJECT(IDirect3DDeviceImpl, IDirect3DDevice3, D3DDevice);
521     TRACE_(ddraw_thunk)("(%p)->(%p,%08x) thunking to IDirect3DVertexBuffer7 interface.\n", This, D3D, Flags);
522
523     return IDirect3DVertexBuffer7_Optimize(ICOM_INTERFACE(This, IDirect3DVertexBuffer7),
524                                            ICOM_INTERFACE(D3D, IDirect3DDevice7),
525                                            Flags);
526 }
527
528 /*****************************************************************************
529  * IDirect3DVertexBuffer7::ProcessVerticesStrided
530  *
531  * This method processes untransformed strided vertices into a processed
532  * or optimized vertex buffer.
533  *
534  * For more details on the parameters, see
535  * IDirect3DVertexBuffer7::ProcessVertices
536  *
537  * Params:
538  *  VertexOp: Operations to perform
539  *  DestIndex: Destination index to write the vertices to
540  *  Count: Number of input vertices
541  *  StrideData: Array containing the input vertices
542  *  VertexTypeDesc: Vertex Description or source index?????????
543  *  D3DDevice: IDirect3DDevice7 to use for processing
544  *  Flags: Can be D3DPV_DONOTCOPYDATA to avoid copying unmodified vertices
545  *
546  * Returns
547  *  D3D_OK on success, or DDERR_*
548  *
549  *****************************************************************************/
550 static HRESULT WINAPI
551 IDirect3DVertexBufferImpl_ProcessVerticesStrided(IDirect3DVertexBuffer7 *iface,
552                                                  DWORD VertexOp,
553                                                  DWORD DestIndex,
554                                                  DWORD Count,
555                                                  D3DDRAWPRIMITIVESTRIDEDDATA *StrideData,
556                                                  DWORD VertexTypeDesc,
557                                                  IDirect3DDevice7 *D3DDevice,
558                                                  DWORD Flags)
559 {
560     ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface);
561     IDirect3DDeviceImpl *D3D = ICOM_OBJECT(IDirect3DDeviceImpl, IDirect3DDevice7, D3DDevice);
562     FIXME("(%p)->(%08x,%08x,%08x,%p,%08x,%p,%08x): stub!\n", This, VertexOp, DestIndex, Count, StrideData, VertexTypeDesc, D3D, Flags);
563     return DD_OK;
564 }
565
566 /*****************************************************************************
567  * The VTables
568  *****************************************************************************/
569
570 const IDirect3DVertexBuffer7Vtbl IDirect3DVertexBuffer7_Vtbl =
571 {
572     /*** IUnknown Methods ***/
573     IDirect3DVertexBufferImpl_QueryInterface,
574     IDirect3DVertexBufferImpl_AddRef,
575     IDirect3DVertexBufferImpl_Release,
576     /*** IDirect3DVertexBuffer Methods ***/
577     IDirect3DVertexBufferImpl_Lock,
578     IDirect3DVertexBufferImpl_Unlock,
579     IDirect3DVertexBufferImpl_ProcessVertices,
580     IDirect3DVertexBufferImpl_GetVertexBufferDesc,
581     IDirect3DVertexBufferImpl_Optimize,
582     /*** IDirect3DVertexBuffer7 Methods ***/
583     IDirect3DVertexBufferImpl_ProcessVerticesStrided
584 };
585
586 const IDirect3DVertexBufferVtbl IDirect3DVertexBuffer1_Vtbl =
587 {
588     /*** IUnknown Methods ***/
589     Thunk_IDirect3DVertexBufferImpl_1_QueryInterface,
590     Thunk_IDirect3DVertexBufferImpl_1_AddRef,
591     Thunk_IDirect3DVertexBufferImpl_1_Release,
592     /*** IDirect3DVertexBuffer Methods ***/
593     Thunk_IDirect3DVertexBufferImpl_1_Lock,
594     Thunk_IDirect3DVertexBufferImpl_1_Unlock,
595     Thunk_IDirect3DVertexBufferImpl_1_ProcessVertices,
596     Thunk_IDirect3DVertexBufferImpl_1_GetVertexBufferDesc,
597     Thunk_IDirect3DVertexBufferImpl_1_Optimize
598 };