2 * IDirect3DResource8 implementation
4 * Copyright 2002 Jason Edmeades
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "wine/debug.h"
27 #include "d3d8_private.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(d3d
);
31 /* IDirect3DResource IUnknown parts follow: */
32 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface
,REFIID riid
,LPVOID
*ppobj
)
34 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
36 if (IsEqualGUID(riid
, &IID_IUnknown
)
37 || IsEqualGUID(riid
, &IID_IClassFactory
)) {
38 IDirect3DVertexBuffer8Impl_AddRef(iface
);
43 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
47 ULONG WINAPI
IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface
) {
48 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
49 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
53 ULONG WINAPI
IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface
) {
54 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
55 ULONG ref
= --This
->ref
;
56 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
58 HeapFree(GetProcessHeap(), 0, This
->allocatedMemory
);
59 HeapFree(GetProcessHeap(), 0, This
);
64 /* IDirect3DResource Interface follow: */
65 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface
, IDirect3DDevice8
** ppDevice
) {
66 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
67 TRACE("(%p) : returning %p\n", This
, This
->Device
);
68 *ppDevice
= (LPDIRECT3DDEVICE8
) This
->Device
;
71 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
) {
72 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
73 FIXME("(%p) : stub\n", This
); return D3D_OK
;
75 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
) {
76 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
77 FIXME("(%p) : stub\n", This
); return D3D_OK
;
79 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface
, REFGUID refguid
) {
80 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
81 FIXME("(%p) : stub\n", This
); return D3D_OK
;
83 DWORD WINAPI
IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface
, DWORD PriorityNew
) {
84 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
85 FIXME("(%p) : stub\n", This
); return D3D_OK
;
87 DWORD WINAPI
IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface
) {
88 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
89 FIXME("(%p) : stub\n", This
); return D3D_OK
;
91 void WINAPI
IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface
) {
92 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
93 FIXME("(%p) : stub\n", This
);
95 D3DRESOURCETYPE WINAPI
IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface
) {
96 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
97 TRACE("(%p) : returning %d\n", This
, This
->ResourceType
);
98 return This
->ResourceType
;
101 /* IDirect3DVertexBuffer8 */
102 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface
, UINT OffsetToLock
, UINT SizeToLock
, BYTE
** ppbData
, DWORD Flags
) {
103 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
104 if (OffsetToLock
) FIXME("(%p) : with non-zero offset!!\n", This
);
105 TRACE("(%p) : returning memory of %p\n", This
, This
->allocatedMemory
);
106 *ppbData
= This
->allocatedMemory
;
109 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface
) {
110 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
111 TRACE("(%p) : stub\n", This
);
114 HRESULT WINAPI
IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface
, D3DVERTEXBUFFER_DESC
*pDesc
) {
115 ICOM_THIS(IDirect3DVertexBuffer8Impl
,iface
);
117 TRACE("(%p)\n", This
);
118 pDesc
->Format
= This
->currentDesc
.Format
;
119 pDesc
->Type
= This
->currentDesc
.Type
;
120 pDesc
->Usage
= This
->currentDesc
.Usage
;
121 pDesc
->Pool
= This
->currentDesc
.Pool
;
122 pDesc
->Size
= This
->currentDesc
.Size
;
123 pDesc
->FVF
= This
->currentDesc
.FVF
;
127 ICOM_VTABLE(IDirect3DVertexBuffer8
) Direct3DVertexBuffer8_Vtbl
=
129 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
130 IDirect3DVertexBuffer8Impl_QueryInterface
,
131 IDirect3DVertexBuffer8Impl_AddRef
,
132 IDirect3DVertexBuffer8Impl_Release
,
133 IDirect3DVertexBuffer8Impl_GetDevice
,
134 IDirect3DVertexBuffer8Impl_SetPrivateData
,
135 IDirect3DVertexBuffer8Impl_GetPrivateData
,
136 IDirect3DVertexBuffer8Impl_FreePrivateData
,
137 IDirect3DVertexBuffer8Impl_SetPriority
,
138 IDirect3DVertexBuffer8Impl_GetPriority
,
139 IDirect3DVertexBuffer8Impl_PreLoad
,
140 IDirect3DVertexBuffer8Impl_GetType
,
141 IDirect3DVertexBuffer8Impl_Lock
,
142 IDirect3DVertexBuffer8Impl_Unlock
,
143 IDirect3DVertexBuffer8Impl_GetDesc