2 * IDirect3DVolumeTexture8 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
26 #include "wine/debug.h"
28 #include "d3d8_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
32 /* IDirect3DVolumeTexture8 IUnknown parts follow: */
33 HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface,REFIID riid,LPVOID *ppobj)
35 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
37 TRACE("(%p) : QueryInterface\n", This);
38 if (IsEqualGUID(riid, &IID_IUnknown)
39 || IsEqualGUID(riid, &IID_IClassFactory)) {
40 IDirect3DVolumeTexture8Impl_AddRef(iface);
45 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
49 ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface) {
50 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
51 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
55 ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface) {
56 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
57 ULONG ref = --This->ref;
60 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
62 for (i=0; i<This->levels; i++) {
63 if (This->volumes[i] != NULL) {
64 TRACE("(%p) : Releasing volume %p\n", This, This->volumes[i]);
65 IDirect3DVolume8Impl_Release((LPDIRECT3DVOLUME8) This->volumes[i]);
68 HeapFree(GetProcessHeap(), 0, This);
73 /* IDirect3DVolumeTexture8 IDirect3DResource8 Interface follow: */
74 HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8** ppDevice) {
75 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
76 TRACE("(%p) : returning %p\n", This, This->Device);
77 *ppDevice = (LPDIRECT3DDEVICE8) This->Device;
80 HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
81 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
82 FIXME("(%p) : stub\n", This); return D3D_OK;
84 HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
85 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
86 FIXME("(%p) : stub\n", This); return D3D_OK;
88 HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid) {
89 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
90 FIXME("(%p) : stub\n", This); return D3D_OK;
92 DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew) {
93 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
94 FIXME("(%p) : stub\n", This); return D3D_OK;
96 DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface) {
97 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
98 FIXME("(%p) : stub\n", This); return D3D_OK;
100 void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface) {
101 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
102 FIXME("(%p) : stub\n", This);
104 D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface) {
105 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
106 TRACE("(%p) : returning %d\n", This, This->ResourceType);
107 return This->ResourceType;
110 /* IDirect3DVolumeTexture8 (Inherited from IDirect3DBaseTexture8) */
111 DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew) {
112 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
113 FIXME("(%p) : stub\n", This); return D3D_OK;
115 DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface) {
116 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
117 FIXME("(%p) : stub\n", This); return D3D_OK;
119 DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface) {
120 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
121 TRACE("(%p) : returning %d\n", This, This->levels);
125 /* IDirect3DVolumeTexture8 */
126 HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,D3DVOLUME_DESC *pDesc) {
127 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
128 if (Level < This->levels) {
129 TRACE("(%p) Level (%d)\n", This, Level);
130 return IDirect3DVolume8Impl_GetDesc((LPDIRECT3DVOLUME8)This->volumes[Level], pDesc);
132 FIXME("(%p) Level (%d)\n", This, Level);
136 HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,IDirect3DVolume8** ppVolumeLevel) {
137 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
138 IDirect3DVolume8Impl_AddRef((LPDIRECT3DVOLUME8)This->volumes[Level]);
139 *ppVolumeLevel = (LPDIRECT3DVOLUME8)This->volumes[Level];
140 TRACE("(%p) : returning %p for level %d\n", This, *ppVolumeLevel, Level);
143 HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) {
144 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
145 TRACE("(%p) Level (%d)\n", This, Level);
146 if (Level < This->levels) {
147 return IDirect3DVolume8Impl_LockBox((LPDIRECT3DVOLUME8)This->volumes[Level], pLockedVolume, pBox, Flags);
149 FIXME("Volume Levels seems too high?!!\n");
153 HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level) {
154 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
156 TRACE("(%p) : stub\n", This);
159 HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX* pDirtyBox) {
160 ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
162 FIXME("(%p) : stub\n", This); return D3D_OK;
166 ICOM_VTABLE(IDirect3DVolumeTexture8) Direct3DVolumeTexture8_Vtbl =
168 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
169 IDirect3DVolumeTexture8Impl_QueryInterface,
170 IDirect3DVolumeTexture8Impl_AddRef,
171 IDirect3DVolumeTexture8Impl_Release,
172 IDirect3DVolumeTexture8Impl_GetDevice,
173 IDirect3DVolumeTexture8Impl_SetPrivateData,
174 IDirect3DVolumeTexture8Impl_GetPrivateData,
175 IDirect3DVolumeTexture8Impl_FreePrivateData,
176 IDirect3DVolumeTexture8Impl_SetPriority,
177 IDirect3DVolumeTexture8Impl_GetPriority,
178 IDirect3DVolumeTexture8Impl_PreLoad,
179 IDirect3DVolumeTexture8Impl_GetType,
180 IDirect3DVolumeTexture8Impl_SetLOD,
181 IDirect3DVolumeTexture8Impl_GetLOD,
182 IDirect3DVolumeTexture8Impl_GetLevelCount,
183 IDirect3DVolumeTexture8Impl_GetLevelDesc,
184 IDirect3DVolumeTexture8Impl_GetVolumeLevel,
185 IDirect3DVolumeTexture8Impl_LockBox,
186 IDirect3DVolumeTexture8Impl_UnlockBox,
187 IDirect3DVolumeTexture8Impl_AddDirtyBox