2 * IDirect3DCubeTexture8 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 /* IDirect3DCubeTexture8 IUnknown parts follow: */
32 HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface,REFIID riid,LPVOID *ppobj)
34 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
35 TRACE("(%p) : QueryInterface\n", This);
36 if (IsEqualGUID(riid, &IID_IUnknown)
37 || IsEqualGUID(riid, &IID_IClassFactory)) {
38 IDirect3DCubeTexture8Impl_AddRef(iface);
43 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
47 ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface) {
48 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
49 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
53 ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface) {
54 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
55 ULONG ref = --This->ref;
58 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
60 for (i=0; i<This->levels; i++) {
61 if (This->surfaces[i] != NULL) {
62 TRACE("(%p) : Releasing surface %p\n", This, This->surfaces[i]);
63 IDirect3DSurface8Impl_Release((LPDIRECT3DSURFACE8) This->surfaces[i]);
66 HeapFree(GetProcessHeap(), 0, This);
71 /* IDirect3DCubeTexture8 IDirect3DResource8 Interface follow: */
72 HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface, IDirect3DDevice8** ppDevice) {
73 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
74 TRACE("(%p) : returning %p\n", This, This->Device);
75 *ppDevice = (LPDIRECT3DDEVICE8) This->Device;
78 HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
79 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
80 FIXME("(%p) : stub\n", This); return D3D_OK;
82 HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
83 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
84 FIXME("(%p) : stub\n", This); return D3D_OK;
86 HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid) {
87 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
88 FIXME("(%p) : stub\n", This); return D3D_OK;
90 DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface, DWORD PriorityNew) {
91 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
92 FIXME("(%p) : stub\n", This); return D3D_OK;
94 DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface) {
95 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
96 FIXME("(%p) : stub\n", This); return D3D_OK;
98 void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface) {
99 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
100 FIXME("(%p) : stub\n", This);
103 D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface) {
104 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
105 TRACE("(%p) : returning %d\n", This, This->ResourceType);
106 return This->ResourceType;
109 /* IDirect3DCubeTexture8 (Inherited from IDirect3DBaseTexture8) */
110 DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface, DWORD LODNew) {
111 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
112 FIXME("(%p) : stub\n", This); return D3D_OK;
114 DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface) {
115 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
116 FIXME("(%p) : stub\n", This); return D3D_OK;
119 DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface) {
120 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
121 TRACE("(%p) : returning %d\n", This, This->levels);
125 /* IDirect3DCubeTexture8 */
126 HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface,UINT Level,D3DSURFACE_DESC *pDesc) {
127 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
128 if (Level < This->levels) {
129 TRACE("(%p) Level (%d)\n", This, Level);
130 return IDirect3DSurface8Impl_GetDesc((LPDIRECT3DSURFACE8)This->surfaces[Level], pDesc);
132 FIXME("(%p) Level (%d)\n", This, Level);
137 HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface8** ppCubeMapSurface) {
138 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
139 TRACE("(%p) : returning %p\n", This, This->surfaces[FaceType][Level]);
140 *ppCubeMapSurface = (LPDIRECT3DSURFACE8) This->surfaces[FaceType][Level];
141 IDirect3DSurface8Impl_AddRef((LPDIRECT3DSURFACE8)This->surfaces[FaceType][Level]);
144 HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) {
145 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
146 FIXME("(%p) : stub\n", This); return D3D_OK;
148 HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level) {
149 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
151 FIXME("(%p) : stub\n", This); return D3D_OK;
153 HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) {
154 ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
156 FIXME("(%p) : stub\n", This); return D3D_OK;
160 ICOM_VTABLE(IDirect3DCubeTexture8) Direct3DCubeTexture8_Vtbl =
162 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
163 IDirect3DCubeTexture8Impl_QueryInterface,
164 IDirect3DCubeTexture8Impl_AddRef,
165 IDirect3DCubeTexture8Impl_Release,
166 IDirect3DCubeTexture8Impl_GetDevice,
167 IDirect3DCubeTexture8Impl_SetPrivateData,
168 IDirect3DCubeTexture8Impl_GetPrivateData,
169 IDirect3DCubeTexture8Impl_FreePrivateData,
170 IDirect3DCubeTexture8Impl_SetPriority,
171 IDirect3DCubeTexture8Impl_GetPriority,
172 IDirect3DCubeTexture8Impl_PreLoad,
173 IDirect3DCubeTexture8Impl_GetType,
174 IDirect3DCubeTexture8Impl_SetLOD,
175 IDirect3DCubeTexture8Impl_GetLOD,
176 IDirect3DCubeTexture8Impl_GetLevelCount,
177 IDirect3DCubeTexture8Impl_GetLevelDesc,
178 IDirect3DCubeTexture8Impl_GetCubeMapSurface,
179 IDirect3DCubeTexture8Impl_LockRect,
180 IDirect3DCubeTexture8Impl_UnlockRect,
181 IDirect3DCubeTexture8Impl_AddDirtyRect