2 * IDirect3DIndexBuffer8 implementation
4 * Copyright 2005 Oliver Stieber
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
22 #include "d3d8_private.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
26 /* IDirect3DIndexBuffer8 IUnknown parts follow: */
27 HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface, REFIID riid, LPVOID *ppobj) {
28 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
30 if (IsEqualGUID(riid, &IID_IUnknown)
31 || IsEqualGUID(riid, &IID_IDirect3DResource8)
32 || IsEqualGUID(riid, &IID_IDirect3DIndexBuffer8)) {
33 IUnknown_AddRef(iface);
38 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
42 ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface) {
43 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
44 ULONG ref = InterlockedIncrement(&This->ref);
46 TRACE("(%p) : AddRef from %ld\n", This, ref - 1);
51 ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface) {
52 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
53 ULONG ref = InterlockedDecrement(&This->ref);
55 TRACE("(%p) : ReleaseRef to %ld\n", This, ref);
58 IWineD3DIndexBuffer_Release(This->wineD3DIndexBuffer);
59 HeapFree(GetProcessHeap(), 0, This);
64 /* IDirect3DIndexBuffer8 IDirect3DResource8 Interface follow: */
65 HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8 **ppDevice) {
66 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
67 TRACE("(%p) Relay\n", This);
68 return IDirect3DResource8Impl_GetDevice((LPDIRECT3DRESOURCE8) This, ppDevice);
71 HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
72 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
73 TRACE("(%p) Relay\n", This);
74 return IWineD3DIndexBuffer_SetPrivateData(This->wineD3DIndexBuffer, refguid, pData, SizeOfData, Flags);
77 HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void *pData, DWORD *pSizeOfData) {
78 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
79 TRACE("(%p) Relay\n", This);
80 return IWineD3DIndexBuffer_GetPrivateData(This->wineD3DIndexBuffer, refguid, pData, pSizeOfData);
83 HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid) {
84 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
85 TRACE("(%p) Relay\n", This);
86 return IWineD3DIndexBuffer_FreePrivateData(This->wineD3DIndexBuffer, refguid);
89 DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew) {
90 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
91 TRACE("(%p) Relay\n", This);
92 return IWineD3DIndexBuffer_SetPriority(This->wineD3DIndexBuffer, PriorityNew);
95 DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface) {
96 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
97 TRACE("(%p) Relay\n", This);
98 return IWineD3DIndexBuffer_GetPriority(This->wineD3DIndexBuffer);
101 void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface) {
102 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
103 TRACE("(%p) Relay\n", This);
104 return IWineD3DIndexBuffer_PreLoad(This->wineD3DIndexBuffer);
107 D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface) {
108 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
109 TRACE("(%p) Relay\n", This);
110 return IWineD3DIndexBuffer_GetType(This->wineD3DIndexBuffer);
113 /* IDirect3DIndexBuffer8 Interface follow: */
114 HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE **ppbData, DWORD Flags) {
115 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
116 TRACE("(%p) Relay\n", This);
117 return IWineD3DIndexBuffer_Lock(This->wineD3DIndexBuffer, OffsetToLock, SizeToLock, ppbData, Flags);
120 HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface) {
121 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
122 TRACE("(%p) Relay\n", This);
123 return IWineD3DIndexBuffer_Unlock(This->wineD3DIndexBuffer);
126 HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc) {
127 IDirect3DIndexBuffer8Impl *This = (IDirect3DIndexBuffer8Impl *)iface;
128 TRACE("(%p) Relay\n", This);
129 return IWineD3DIndexBuffer_GetDesc(This->wineD3DIndexBuffer, pDesc);
133 const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl =
136 IDirect3DIndexBuffer8Impl_QueryInterface,
137 IDirect3DIndexBuffer8Impl_AddRef,
138 IDirect3DIndexBuffer8Impl_Release,
139 /* IDirect3DResource8 */
140 IDirect3DIndexBuffer8Impl_GetDevice,
141 IDirect3DIndexBuffer8Impl_SetPrivateData,
142 IDirect3DIndexBuffer8Impl_GetPrivateData,
143 IDirect3DIndexBuffer8Impl_FreePrivateData,
144 IDirect3DIndexBuffer8Impl_SetPriority,
145 IDirect3DIndexBuffer8Impl_GetPriority,
146 IDirect3DIndexBuffer8Impl_PreLoad,
147 IDirect3DIndexBuffer8Impl_GetType,
148 /* IDirect3DIndexBuffer8 */
149 IDirect3DIndexBuffer8Impl_Lock,
150 IDirect3DIndexBuffer8Impl_Unlock,
151 IDirect3DIndexBuffer8Impl_GetDesc