2 * IDirect3DIndexBuffer8 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 /* IDirect3DIndexBuffer8 IUnknown parts follow: */
32 HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface,REFIID riid,LPVOID *ppobj)
34 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
36 if (IsEqualGUID(riid, &IID_IUnknown)
37 || IsEqualGUID(riid, &IID_IClassFactory)) {
38 IDirect3DIndexBuffer8Impl_AddRef(iface);
43 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
47 ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface) {
48 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
49 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
53 ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface) {
54 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
55 ULONG ref = --This->ref;
56 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
58 HeapFree(GetProcessHeap(), 0, This);
59 HeapFree(GetProcessHeap(), 0, This->allocatedMemory);
64 /* IDirect3DResource Interface follow: */
65 HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8** ppDevice) {
66 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
67 TRACE("(%p) : returning %p\n", This, This->Device);
68 *ppDevice = (LPDIRECT3DDEVICE8) This->Device;
71 HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
72 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
73 FIXME("(%p) : stub\n", This); return D3D_OK;
75 HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
76 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
77 FIXME("(%p) : stub\n", This); return D3D_OK;
79 HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid) {
80 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
81 FIXME("(%p) : stub\n", This); return D3D_OK;
83 DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew) {
84 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
85 FIXME("(%p) : stub\n", This); return D3D_OK;
87 DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface) {
88 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
89 FIXME("(%p) : stub\n", This); return D3D_OK;
91 void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface) {
92 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
93 FIXME("(%p) : stub\n", This);
95 D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface) {
96 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
97 TRACE("(%p) : returning %d\n", This, This->ResourceType);
98 return This->ResourceType;
101 /* IDirect3DIndexBuffer8 */
102 HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags) {
103 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
104 if (OffsetToLock==0) {
105 TRACE("(%p) : no locking yet, offset %d, size %d, Flags=%lx\n", This, OffsetToLock, SizeToLock, Flags);
107 FIXME("(%p) : stub, offset %d, size %d, Flags=%lx\n", This, OffsetToLock, SizeToLock, Flags);
109 *ppbData = This->allocatedMemory;
113 HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface) {
114 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
115 TRACE("(%p) : stub\n", This);
118 HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc) {
119 ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
121 TRACE("(%p) : copying into %p\n", This, pDesc);
122 memcpy(pDesc, &This->currentDesc, sizeof(D3DINDEXBUFFER_DESC));
126 ICOM_VTABLE(IDirect3DIndexBuffer8) Direct3DIndexBuffer8_Vtbl =
128 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
129 IDirect3DIndexBuffer8Impl_QueryInterface,
130 IDirect3DIndexBuffer8Impl_AddRef,
131 IDirect3DIndexBuffer8Impl_Release,
132 IDirect3DIndexBuffer8Impl_GetDevice,
133 IDirect3DIndexBuffer8Impl_SetPrivateData,
134 IDirect3DIndexBuffer8Impl_GetPrivateData,
135 IDirect3DIndexBuffer8Impl_FreePrivateData,
136 IDirect3DIndexBuffer8Impl_SetPriority,
137 IDirect3DIndexBuffer8Impl_GetPriority,
138 IDirect3DIndexBuffer8Impl_PreLoad,
139 IDirect3DIndexBuffer8Impl_GetType,
140 IDirect3DIndexBuffer8Impl_Lock,
141 IDirect3DIndexBuffer8Impl_Unlock,
142 IDirect3DIndexBuffer8Impl_GetDesc