ReactOS 0.4.15-dev-8417-gb6b82fe
vertexbuffer.c
Go to the documentation of this file.
1/* Direct3D Vertex Buffer
2 * Copyright (c) 2002 Lionel ULMER
3 * Copyright (c) 2006 Stefan DÖSINGER
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include "config.h"
21#include "wine/port.h"
22
23#include "ddraw_private.h"
24
26
27static inline struct d3d_vertex_buffer *impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
28{
30}
31
32/*****************************************************************************
33 * IUnknown Methods
34 *****************************************************************************/
35
36static HRESULT WINAPI d3d_vertex_buffer7_QueryInterface(IDirect3DVertexBuffer7 *iface, REFIID riid, void **obj)
37{
39
40 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), obj);
41
42 *obj = NULL;
43
45 {
47 *obj = iface;
48 return S_OK;
49 }
50 if (IsEqualGUID(&IID_IDirect3DVertexBuffer7, riid) && buffer->version == 7)
51 {
53 *obj = iface;
54 return S_OK;
55 }
56 if (IsEqualGUID(&IID_IDirect3DVertexBuffer, riid) && buffer->version == 3)
57 {
59 *obj = iface;
60 return S_OK;
61 }
62
63 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
64 return E_NOINTERFACE;
65}
66
67static ULONG WINAPI d3d_vertex_buffer7_AddRef(IDirect3DVertexBuffer7 *iface)
68{
71
72 TRACE("%p increasing refcount to %u.\n", buffer, ref);
73
74 return ref;
75}
76
77static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface)
78{
81
82 TRACE("%p decreasing refcount to %u.\n", buffer, ref);
83
84 if (!ref)
85 {
86 struct wined3d_buffer *vb = NULL;
88
89 /* D3D7 vertex buffers don't stay bound in the device, they are passed
90 * as a parameter to DrawPrimitiveVB. DrawPrimitiveVB sets them as the
91 * stream source in wined3d and they should get unset there before
92 * they are destroyed. */
94 wined3d_device_get_stream_source(buffer->ddraw->wined3d_device, 0, &vb, &offset, &stride);
95 if (vb == buffer->wined3d_buffer)
96 wined3d_device_set_stream_source(buffer->ddraw->wined3d_device, 0, NULL, 0, 0);
97
98 wined3d_vertex_declaration_decref(buffer->wined3d_declaration);
99 wined3d_buffer_decref(buffer->wined3d_buffer);
101
102 if (buffer->version == 7)
103 IDirectDraw7_Release(&buffer->ddraw->IDirectDraw7_iface);
104
106 }
107
108 return ref;
109}
110
111/*****************************************************************************
112 * IDirect3DVertexBuffer Methods
113 *****************************************************************************/
114
117{
119
120 desc.byte_width = buffer->size;
122 if (buffer->Caps & D3DVBCAPS_WRITEONLY)
124 if (dynamic)
125 desc.usage |= WINED3DUSAGE_DYNAMIC;
126 desc.bind_flags = WINED3D_BIND_VERTEX_BUFFER;
127 if (buffer->Caps & D3DVBCAPS_SYSTEMMEMORY)
129 else
131 desc.misc_flags = 0;
132 desc.structure_byte_stride = 0;
133
134 return wined3d_buffer_create(buffer->ddraw->wined3d_device, &desc,
136}
137
138/*****************************************************************************
139 * IDirect3DVertexBuffer7::Lock
140 *
141 * Locks the vertex buffer and returns a pointer to the vertex data
142 * Locking vertex buffers is similar to locking surfaces, because Windows
143 * uses surfaces to store vertex data internally (According to the DX sdk)
144 *
145 * Params:
146 * Flags: Locking flags. Relevant here are DDLOCK_READONLY, DDLOCK_WRITEONLY,
147 * DDLOCK_DISCARDCONTENTS and DDLOCK_NOOVERWRITE.
148 * Data: Returns a pointer to the vertex data
149 * Size: Returns the size of the buffer if not NULL
150 *
151 * Returns:
152 * D3D_OK on success
153 * DDERR_INVALIDPARAMS if Data is NULL
154 * D3DERR_VERTEXBUFFEROPTIMIZED if called on an optimized buffer(WineD3D)
155 *
156 *****************************************************************************/
157static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
158 DWORD flags, void **data, DWORD *data_size)
159{
161 struct wined3d_resource_desc wined3d_desc;
164 HRESULT hr;
165
166 TRACE("iface %p, flags %#x, data %p, data_size %p.\n", iface, flags, data, data_size);
167
168 if (buffer->version != 7)
170
171 if (!(flags & DDLOCK_WAIT))
174 {
175 if (!buffer->dynamic)
176 {
177 struct wined3d_buffer *new_buffer;
180 if (SUCCEEDED(hr))
181 {
182 buffer->dynamic = TRUE;
183 wined3d_buffer_decref(buffer->wined3d_buffer);
184 buffer->wined3d_buffer = new_buffer;
185 }
186 else
187 {
188 WARN("Failed to create a dynamic buffer\n");
189 }
191 }
192 }
193
195 if (data_size)
196 {
197 /* Get the size, for returning it, and for locking */
200 *data_size = wined3d_desc.size;
201 }
202
206
208
209 return hr;
210}
211
212/*****************************************************************************
213 * IDirect3DVertexBuffer7::Unlock
214 *
215 * Unlocks a vertex Buffer
216 *
217 * Returns:
218 * D3D_OK on success
219 *
220 *****************************************************************************/
221static HRESULT WINAPI d3d_vertex_buffer7_Unlock(IDirect3DVertexBuffer7 *iface)
222{
224
225 TRACE("iface %p.\n", iface);
226
230
231 return D3D_OK;
232}
233
234/*****************************************************************************
235 * IDirect3DVertexBuffer7::ProcessVertices
236 *
237 * Processes untransformed Vertices into a transformed or optimized vertex
238 * buffer. It can also perform other operations, such as lighting or clipping
239 *
240 * Params
241 * VertexOp: Operation(s) to perform: D3DVOP_CLIP, _EXTENTS, _LIGHT, _TRANSFORM
242 * DestIndex: Index in the destination buffer(This), where the vertices are
243 * placed
244 * Count: Number of Vertices in the Source buffer to process
245 * SrcBuffer: Source vertex buffer
246 * SrcIndex: Index of the first vertex in the src buffer to process
247 * D3DDevice: Device to use for transformation
248 * Flags: 0 for default, D3DPV_DONOTCOPYDATA to prevent copying
249 * unchanged vertices
250 *
251 * Returns:
252 * D3D_OK on success
253 * DDERR_INVALIDPARAMS If D3DVOP_TRANSFORM wasn't passed
254 *
255 *****************************************************************************/
256static HRESULT WINAPI d3d_vertex_buffer7_ProcessVertices(IDirect3DVertexBuffer7 *iface,
257 DWORD vertex_op, DWORD dst_idx, DWORD count, IDirect3DVertexBuffer7 *src_buffer,
258 DWORD src_idx, IDirect3DDevice7 *device, DWORD flags)
259{
260 struct d3d_vertex_buffer *dst_buffer_impl = impl_from_IDirect3DVertexBuffer7(iface);
261 struct d3d_vertex_buffer *src_buffer_impl = unsafe_impl_from_IDirect3DVertexBuffer7(src_buffer);
262 struct d3d_device *device_impl = dst_buffer_impl->version == 7
264 : unsafe_impl_from_IDirect3DDevice3((IDirect3DDevice3 *)device);
265 BOOL oldClip, doClip;
266 HRESULT hr;
267
268 TRACE("iface %p, vertex_op %#x, dst_idx %u, count %u, src_buffer %p, src_idx %u, device %p, flags %#x.\n",
269 iface, vertex_op, dst_idx, count, src_buffer, src_idx, device, flags);
270
271 /* Vertex operations:
272 * D3DVOP_CLIP: Clips vertices outside the viewing frustrum. Needs clipping information
273 * in the vertex buffer (Buffer may not be created with D3DVBCAPS_DONOTCLIP)
274 * D3DVOP_EXTENTS: Causes the screen extents to be updated when rendering the vertices
275 * D3DVOP_LIGHT: Lights the vertices
276 * D3DVOP_TRANSFORM: Transform the vertices. This flag is necessary
277 *
278 * WineD3D only transforms and clips the vertices by now, so EXTENTS and LIGHT
279 * are not implemented. Clipping is disabled ATM, because of unsure conditions.
280 */
281 if (!(vertex_op & D3DVOP_TRANSFORM))
282 return DDERR_INVALIDPARAMS;
283
285
286 /* WineD3D doesn't know d3d7 vertex operation, it uses
287 * render states instead. Set the render states according to
288 * the vertex ops
289 */
290 doClip = !!(vertex_op & D3DVOP_CLIP);
292 if (doClip != oldClip)
294
296 0, src_buffer_impl->wined3d_buffer, 0, get_flexible_vertex_size(src_buffer_impl->fvf));
298 hr = wined3d_device_process_vertices(device_impl->wined3d_device, src_idx, dst_idx,
299 count, dst_buffer_impl->wined3d_buffer, NULL, flags, dst_buffer_impl->fvf);
300
301 /* Restore the states if needed */
302 if (doClip != oldClip)
304
306
307 return hr;
308}
309
310/*****************************************************************************
311 * IDirect3DVertexBuffer7::GetVertexBufferDesc
312 *
313 * Returns the description of a vertex buffer
314 *
315 * Params:
316 * Desc: Address to write the description to
317 *
318 * Returns
319 * DDERR_INVALIDPARAMS if Desc is NULL
320 * D3D_OK on success
321 *
322 *****************************************************************************/
324{
326 struct wined3d_resource_desc wined3d_desc;
328
329 TRACE("iface %p, desc %p.\n", iface, desc);
330
331 if (!desc) return DDERR_INVALIDPARAMS;
332
337
338 /* Now fill the desc structure */
339 desc->dwCaps = buffer->Caps;
340 desc->dwFVF = buffer->fvf;
341 desc->dwNumVertices = wined3d_desc.size / get_flexible_vertex_size(buffer->fvf);
342
343 return D3D_OK;
344}
345
346/*****************************************************************************
347 * IDirect3DVertexBuffer7::Optimize
348 *
349 * Converts an unoptimized vertex buffer into an optimized buffer
350 *
351 * Params:
352 * D3DDevice: Device for which this buffer is optimized
353 * Flags: Not used, should be set to 0
354 *
355 * Returns
356 * D3D_OK, because it's a stub
357 *
358 *****************************************************************************/
359static HRESULT WINAPI d3d_vertex_buffer7_Optimize(IDirect3DVertexBuffer7 *iface,
360 IDirect3DDevice7 *device, DWORD flags)
361{
363 static BOOL hide = FALSE;
364
365 TRACE("iface %p, device %p, flags %#x.\n", iface, device, flags);
366
367 if (!hide)
368 {
369 FIXME("iface %p, device %p, flags %#x stub!\n", iface, device, flags);
370 hide = TRUE;
371 }
372
373 /* We could forward this call to WineD3D and take advantage
374 * of it once we use OpenGL vertex buffers
375 */
379
380 return DD_OK;
381}
382
383/*****************************************************************************
384 * IDirect3DVertexBuffer7::ProcessVerticesStrided
385 *
386 * This method processes untransformed strided vertices into a processed
387 * or optimized vertex buffer.
388 *
389 * For more details on the parameters, see
390 * IDirect3DVertexBuffer7::ProcessVertices
391 *
392 * Params:
393 * VertexOp: Operations to perform
394 * DestIndex: Destination index to write the vertices to
395 * Count: Number of input vertices
396 * StrideData: Array containing the input vertices
397 * VertexTypeDesc: Vertex Description or source index?????????
398 * D3DDevice: IDirect3DDevice7 to use for processing
399 * Flags: Can be D3DPV_DONOTCOPYDATA to avoid copying unmodified vertices
400 *
401 * Returns
402 * D3D_OK on success, or DDERR_*
403 *
404 *****************************************************************************/
405static HRESULT WINAPI d3d_vertex_buffer7_ProcessVerticesStrided(IDirect3DVertexBuffer7 *iface,
407 DWORD fvf, IDirect3DDevice7 *device, DWORD flags)
408{
409 FIXME("iface %p, vertex_op %#x, dst_idx %u, count %u, data %p, fvf %#x, device %p, flags %#x stub!\n",
410 iface, vertex_op, dst_idx, count, data, fvf, device, flags);
411
412 return DD_OK;
413}
414
415/*****************************************************************************
416 * The VTables
417 *****************************************************************************/
418
419static const struct IDirect3DVertexBuffer7Vtbl d3d_vertex_buffer7_vtbl =
420{
430};
431
434{
436 HRESULT hr = D3D_OK;
437
438 TRACE("Vertex buffer description:\n");
439 TRACE(" dwSize %u\n", desc->dwSize);
440 TRACE(" dwCaps %#x\n", desc->dwCaps);
441 TRACE(" FVF %#x\n", desc->dwFVF);
442 TRACE(" dwNumVertices %u\n", desc->dwNumVertices);
443
444 if (!(buffer = heap_alloc_zero(sizeof(*buffer))))
445 return DDERR_OUTOFMEMORY;
446
447 buffer->IDirect3DVertexBuffer7_iface.lpVtbl = &d3d_vertex_buffer7_vtbl;
448 buffer->ref = 1;
449 buffer->version = ddraw->d3dversion;
450 if (buffer->version == 7)
451 IDirectDraw7_AddRef(&ddraw->IDirectDraw7_iface);
452 buffer->ddraw = ddraw;
453 buffer->Caps = desc->dwCaps;
454 buffer->fvf = desc->dwFVF;
455 buffer->size = get_flexible_vertex_size(desc->dwFVF) * desc->dwNumVertices;
456
458
460 {
461 WARN("Failed to create wined3d vertex buffer, hr %#x.\n", hr);
464 goto end;
465 }
466
467 if (!(buffer->wined3d_declaration = ddraw_find_decl(ddraw, desc->dwFVF)))
468 {
469 ERR("Failed to find vertex declaration for fvf %#x.\n", desc->dwFVF);
470 wined3d_buffer_decref(buffer->wined3d_buffer);
472 goto end;
473 }
474 wined3d_vertex_declaration_incref(buffer->wined3d_declaration);
475
476end:
478 if (hr == D3D_OK)
479 *vertex_buf = buffer;
480 else
482
483 return hr;
484}
485
486struct d3d_vertex_buffer *unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
487{
488 if (!iface)
489 return NULL;
490 assert(iface->lpVtbl == &d3d_vertex_buffer7_vtbl);
491
493}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DVertexBuffer7_AddRef(p)
Definition: d3d.h:1514
#define D3DVOP_CLIP
Definition: d3dtypes.h:1287
#define D3DVBCAPS_OPTIMIZED
Definition: d3dtypes.h:1282
#define D3DVOP_TRANSFORM
Definition: d3dtypes.h:1286
#define D3DVBCAPS_WRITEONLY
Definition: d3dtypes.h:1281
#define D3DVBCAPS_SYSTEMMEMORY
Definition: d3dtypes.h:1280
struct d3d_device * unsafe_impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface) DECLSPEC_HIDDEN
Definition: device.c:6850
struct d3d_device * unsafe_impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface) DECLSPEC_HIDDEN
Definition: device.c:6857
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN
Definition: utils.c:923
unsigned int wined3dmapflags_from_ddrawmapflags(unsigned int flags) DECLSPEC_HIDDEN
Definition: utils.c:564
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
struct wined3d_vertex_declaration * ddraw_find_decl(struct ddraw *This, DWORD fvf)
Definition: ddraw.c:4797
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
Definition: ddraw.c:83
HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
Definition: buffer.c:1436
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
Definition: buffer.c:791
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:995
void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, struct wined3d_vertex_declaration *declaration)
Definition: device.c:2157
DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state)
Definition: device.c:2064
HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
Definition: device.c:3340
HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride)
Definition: device.c:1428
void CDECL wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, DWORD value)
Definition: device.c:2027
HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
Definition: device.c:1378
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:295
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
Definition: resource.c:344
#define assert(x)
Definition: debug.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint end
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei stride
Definition: glext.h:5848
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161
GLintptr offset
Definition: glext.h:5920
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
static const WCHAR desc[]
Definition: protectdata.c:36
unsigned int UINT
Definition: ndis.h:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define DDLOCK_DONOTWAIT
Definition: ddraw.h:630
#define DD_OK
Definition: ddraw.h:186
#define DDLOCK_DISCARDCONTENTS
Definition: ddraw.h:628
#define DDLOCK_NOOVERWRITE
Definition: ddraw.h:627
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
#define DDLOCK_WAIT
Definition: ddraw.h:622
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_device * wined3d_device
struct wined3d_vertex_declaration * wined3d_declaration
struct ddraw * ddraw
struct wined3d_buffer * wined3d_buffer
IDirect3DVertexBuffer7 IDirect3DVertexBuffer7_iface
unsigned int version
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
int d3dversion
Definition: devices.h:37
Definition: send.c:48
unsigned int size
Definition: wined3d.h:1761
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
static HRESULT WINAPI d3d_vertex_buffer7_Unlock(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:221
static HRESULT WINAPI d3d_vertex_buffer7_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface, D3DVERTEXBUFFERDESC *desc)
Definition: vertexbuffer.c:323
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **vertex_buf, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc)
Definition: vertexbuffer.c:432
static HRESULT WINAPI d3d_vertex_buffer7_QueryInterface(IDirect3DVertexBuffer7 *iface, REFIID riid, void **obj)
Definition: vertexbuffer.c:36
static HRESULT WINAPI d3d_vertex_buffer7_ProcessVerticesStrided(IDirect3DVertexBuffer7 *iface, DWORD vertex_op, DWORD dst_idx, DWORD count, D3DDRAWPRIMITIVESTRIDEDDATA *data, DWORD fvf, IDirect3DDevice7 *device, DWORD flags)
Definition: vertexbuffer.c:405
static HRESULT d3d_vertex_buffer_create_wined3d_buffer(struct d3d_vertex_buffer *buffer, BOOL dynamic, struct wined3d_buffer **wined3d_buffer)
Definition: vertexbuffer.c:115
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:486
static HRESULT WINAPI d3d_vertex_buffer7_ProcessVertices(IDirect3DVertexBuffer7 *iface, DWORD vertex_op, DWORD dst_idx, DWORD count, IDirect3DVertexBuffer7 *src_buffer, DWORD src_idx, IDirect3DDevice7 *device, DWORD flags)
Definition: vertexbuffer.c:256
static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:77
static ULONG WINAPI d3d_vertex_buffer7_AddRef(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:67
static const struct IDirect3DVertexBuffer7Vtbl d3d_vertex_buffer7_vtbl
Definition: vertexbuffer.c:419
static HRESULT WINAPI d3d_vertex_buffer7_Optimize(IDirect3DVertexBuffer7 *iface, IDirect3DDevice7 *device, DWORD flags)
Definition: vertexbuffer.c:359
static struct d3d_vertex_buffer * impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
Definition: vertexbuffer.c:27
static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface, DWORD flags, void **data, DWORD *data_size)
Definition: vertexbuffer.c:157
#define WINAPI
Definition: msvc.h:6
ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration)
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
#define WINED3DUSAGE_WRITEONLY
Definition: wined3d.h:901
@ WINED3D_RS_CLIPPING
Definition: wined3d.h:323
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:890
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:55
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:56
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:907
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:48
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:920
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define E_NOINTERFACE
Definition: winerror.h:2364