2 * IDirect3DVolumeTexture8 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 /* IDirect3DVolumeTexture8 IUnknown parts follow: */
27 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface
, REFIID riid
, LPVOID
*ppobj
) {
28 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
30 if (IsEqualGUID(riid
, &IID_IUnknown
)
31 || IsEqualGUID(riid
, &IID_IDirect3DResource8
)
32 || IsEqualGUID(riid
, &IID_IDirect3DBaseTexture8
)
33 || IsEqualGUID(riid
, &IID_IDirect3DVolumeTexture8
)) {
34 IUnknown_AddRef(iface
);
39 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
43 ULONG WINAPI
IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface
) {
44 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
45 ULONG ref
= InterlockedIncrement(&This
->ref
);
47 TRACE("(%p) : AddRef from %ld\n", This
, ref
- 1);
52 ULONG WINAPI
IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface
) {
53 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
54 ULONG ref
= InterlockedDecrement(&This
->ref
);
56 TRACE("(%p) : ReleaseRef to %ld\n", This
, ref
);
59 IWineD3DVolumeTexture_Release(This
->wineD3DVolumeTexture
);
60 HeapFree(GetProcessHeap(), 0, This
);
65 /* IDirect3DVolumeTexture8 IDirect3DResource8 Interface follow: */
66 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface
, IDirect3DDevice8
**ppDevice
) {
67 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
68 TRACE("(%p) Relay\n", This
);
69 return IDirect3DResource8Impl_GetDevice((LPDIRECT3DRESOURCE8
) This
, ppDevice
);
72 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
) {
73 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
74 TRACE("(%p) Relay\n", This
);
75 return IWineD3DVolumeTexture_SetPrivateData(This
->wineD3DVolumeTexture
, refguid
, pData
, SizeOfData
, Flags
);
78 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface
, REFGUID refguid
, void *pData
, DWORD
*pSizeOfData
) {
79 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
80 TRACE("(%p) Relay\n", This
);
81 return IWineD3DVolumeTexture_GetPrivateData(This
->wineD3DVolumeTexture
, refguid
, pData
, pSizeOfData
);
84 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface
, REFGUID refguid
) {
85 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
86 TRACE("(%p) Relay\n", This
);
87 return IWineD3DVolumeTexture_FreePrivateData(This
->wineD3DVolumeTexture
, refguid
);
90 DWORD WINAPI
IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface
, DWORD PriorityNew
) {
91 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
92 TRACE("(%p) Relay\n", This
);
93 return IWineD3DVolumeTexture_SetPriority(This
->wineD3DVolumeTexture
, PriorityNew
);
96 DWORD WINAPI
IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface
) {
97 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
98 TRACE("(%p) Relay\n", This
);
99 return IWineD3DVolumeTexture_GetPriority(This
->wineD3DVolumeTexture
);
102 void WINAPI
IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface
) {
103 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
104 TRACE("(%p) Relay\n", This
);
105 return IWineD3DVolumeTexture_PreLoad(This
->wineD3DVolumeTexture
);
108 D3DRESOURCETYPE WINAPI
IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface
) {
109 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
110 TRACE("(%p) Relay\n", This
);
111 return IWineD3DVolumeTexture_GetType(This
->wineD3DVolumeTexture
);
114 /* IDirect3DVolumeTexture8 IDirect3DBaseTexture8 Interface follow: */
115 DWORD WINAPI
IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface
, DWORD LODNew
) {
116 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
117 TRACE("(%p) Relay\n", This
);
118 return IWineD3DVolumeTexture_SetLOD(This
->wineD3DVolumeTexture
, LODNew
);
121 DWORD WINAPI
IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface
) {
122 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
123 TRACE("(%p) Relay\n", This
);
124 return IWineD3DVolumeTexture_GetLOD(This
->wineD3DVolumeTexture
);
127 DWORD WINAPI
IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface
) {
128 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
129 TRACE("(%p) Relay\n", This
);
130 return IWineD3DVolumeTexture_GetLevelCount(This
->wineD3DVolumeTexture
);
133 /* IDirect3DVolumeTexture8 Interface follow: */
134 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
, D3DVOLUME_DESC
* pDesc
) {
135 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
136 WINED3DVOLUME_DESC wined3ddesc
;
139 TRACE("(%p) Relay\n", This
);
141 /* As d3d8 and d3d8 structures differ, pass in ptrs to where data needs to go */
142 wined3ddesc
.Format
= (WINED3DFORMAT
*)&pDesc
->Format
;
143 wined3ddesc
.Type
= &pDesc
->Type
;
144 wined3ddesc
.Usage
= &pDesc
->Usage
;
145 wined3ddesc
.Pool
= &pDesc
->Pool
;
146 wined3ddesc
.Size
= &tmpInt
;
147 wined3ddesc
.Width
= &pDesc
->Width
;
148 wined3ddesc
.Height
= &pDesc
->Height
;
149 wined3ddesc
.Depth
= &pDesc
->Depth
;
151 return IWineD3DVolumeTexture_GetLevelDesc(This
->wineD3DVolumeTexture
, Level
, &wined3ddesc
);
154 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
, IDirect3DVolume8
**ppVolumeLevel
) {
155 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
156 HRESULT hrc
= D3D_OK
;
157 IWineD3DVolume
*myVolume
= NULL
;
159 TRACE("(%p) Relay\n", This
);
161 hrc
= IWineD3DVolumeTexture_GetVolumeLevel(This
->wineD3DVolumeTexture
, Level
, &myVolume
);
162 if (hrc
== D3D_OK
&& NULL
!= ppVolumeLevel
) {
163 IWineD3DVolumeTexture_GetParent(myVolume
, (IUnknown
**)ppVolumeLevel
);
164 IWineD3DVolumeTexture_Release(myVolume
);
169 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
, D3DLOCKED_BOX
*pLockedVolume
, CONST D3DBOX
*pBox
, DWORD Flags
) {
170 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
171 TRACE("(%p) Relay %p %p %p %ld\n", This
, This
->wineD3DVolumeTexture
, pLockedVolume
, pBox
,Flags
);
172 return IWineD3DVolumeTexture_LockBox(This
->wineD3DVolumeTexture
, Level
, pLockedVolume
, pBox
, Flags
);
175 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
) {
176 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
177 TRACE("(%p) Relay %p %d\n", This
, This
->wineD3DVolumeTexture
, Level
);
178 return IWineD3DVolumeTexture_UnlockBox(This
->wineD3DVolumeTexture
, Level
);
181 HRESULT WINAPI
IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface
, CONST D3DBOX
*pDirtyBox
) {
182 IDirect3DVolumeTexture8Impl
*This
= (IDirect3DVolumeTexture8Impl
*)iface
;
183 TRACE("(%p) Relay\n", This
);
184 return IWineD3DVolumeTexture_AddDirtyBox(This
->wineD3DVolumeTexture
, pDirtyBox
);
188 const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl
=
191 IDirect3DVolumeTexture8Impl_QueryInterface
,
192 IDirect3DVolumeTexture8Impl_AddRef
,
193 IDirect3DVolumeTexture8Impl_Release
,
194 /* IDirect3DResource8 */
195 IDirect3DVolumeTexture8Impl_GetDevice
,
196 IDirect3DVolumeTexture8Impl_SetPrivateData
,
197 IDirect3DVolumeTexture8Impl_GetPrivateData
,
198 IDirect3DVolumeTexture8Impl_FreePrivateData
,
199 IDirect3DVolumeTexture8Impl_SetPriority
,
200 IDirect3DVolumeTexture8Impl_GetPriority
,
201 IDirect3DVolumeTexture8Impl_PreLoad
,
202 IDirect3DVolumeTexture8Impl_GetType
,
203 /* IDirect3DBaseTexture8 */
204 IDirect3DVolumeTexture8Impl_SetLOD
,
205 IDirect3DVolumeTexture8Impl_GetLOD
,
206 IDirect3DVolumeTexture8Impl_GetLevelCount
,
207 /* IDirect3DVolumeTexture8 */
208 IDirect3DVolumeTexture8Impl_GetLevelDesc
,
209 IDirect3DVolumeTexture8Impl_GetVolumeLevel
,
210 IDirect3DVolumeTexture8Impl_LockBox
,
211 IDirect3DVolumeTexture8Impl_UnlockBox
,
212 IDirect3DVolumeTexture8Impl_AddDirtyBox