2 * IWineD3DCubeTexture implementation
4 * Copyright 2002-2005 Jason Edmeades
5 * Copyright 2002-2005 Raphael Junqueira
6 * Copyright 2005 Oliver Stieber
7 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wined3d_private.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture
);
29 #define GLINFO_LOCATION (*gl_info)
31 static void cubetexture_internal_preload(IWineD3DBaseTexture
*iface
, enum WINED3DSRGB srgb
)
33 /* Override the IWineD3DResource Preload method. */
34 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
35 IWineD3DDeviceImpl
*device
= This
->resource
.wineD3DDevice
;
47 cubetexture_internal_preload(iface
, SRGB_RGB
);
55 srgb_mode
= This
->baseTexture
.is_srgb
;
58 dirty
= srgb_mode
? &This
->baseTexture
.srgbDirty
: &This
->baseTexture
.dirty
;
60 TRACE("(%p) : About to load texture: dirtified(%u).\n", This
, *dirty
);
62 /* We only have to activate a context for gl when we're not drawing.
63 * In most cases PreLoad will be called during draw and a context was
64 * activated at the beginning of drawPrimitive. */
65 if (!device
->isInDraw
)
67 /* No danger of recursive calls, ActivateContext sets isInDraw to true
68 * when loading offscreen render targets into their texture. */
69 ActivateContext(device
, device
->lastActiveRenderTarget
, CTXUSAGE_RESOURCELOAD
);
72 if (This
->resource
.format_desc
->format
== WINED3DFMT_P8
73 || This
->resource
.format_desc
->format
== WINED3DFMT_A8P8
)
75 for (i
= 0; i
< This
->baseTexture
.levels
; ++i
)
77 for (j
= WINED3DCUBEMAP_FACE_POSITIVE_X
; j
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
; ++j
)
79 if (palette9_changed((IWineD3DSurfaceImpl
*)This
->surfaces
[j
][i
]))
81 TRACE("Reloading surface because the d3d8/9 palette was changed.\n");
82 /* TODO: This is not necessarily needed with hw palettized texture support. */
83 IWineD3DSurface_LoadLocation(This
->surfaces
[j
][i
], SFLAG_INSYSMEM
, NULL
);
84 /* Make sure the texture is reloaded because of the palette change,
85 * this kills performance though :( */
86 IWineD3DSurface_ModifyLocation(This
->surfaces
[j
][i
], SFLAG_INTEXTURE
, FALSE
);
92 /* If the texture is marked dirty or the srgb sampler setting has changed
93 * since the last load then reload the surfaces. */
96 for (i
= 0; i
< This
->baseTexture
.levels
; ++i
)
98 for (j
= WINED3DCUBEMAP_FACE_POSITIVE_X
; j
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
; ++j
)
100 IWineD3DSurface_LoadTexture(This
->surfaces
[j
][i
], srgb_mode
);
106 TRACE("(%p) Texture not dirty, nothing to do.\n" , iface
);
109 /* No longer dirty. */
113 static void cubetexture_cleanup(IWineD3DCubeTextureImpl
*This
, D3DCB_DESTROYSURFACEFN surface_destroy_cb
)
117 TRACE("(%p) : Cleaning up.\n", This
);
119 for (i
= 0; i
< This
->baseTexture
.levels
; ++i
)
121 for (j
= 0; j
< 6; ++j
)
123 IWineD3DSurface
*surface
= This
->surfaces
[j
][i
];
127 /* Clean out the texture name we gave to the surface so that the
128 * surface doesn't try and release it. */
129 surface_set_texture_name(surface
, 0, TRUE
);
130 surface_set_texture_name(surface
, 0, FALSE
);
131 surface_set_texture_target(surface
, 0);
132 IWineD3DSurface_SetContainer(surface
, NULL
);
133 surface_destroy_cb(surface
);
137 basetexture_cleanup((IWineD3DBaseTexture
*)This
);
140 HRESULT
cubetexture_init(IWineD3DCubeTextureImpl
*texture
, UINT edge_length
, UINT levels
,
141 IWineD3DDeviceImpl
*device
, DWORD usage
, WINED3DFORMAT format
, WINED3DPOOL pool
, IUnknown
*parent
)
143 const WineD3D_GL_Info
*gl_info
= &device
->adapter
->gl_info
;
144 const struct GlPixelFormatDesc
*format_desc
= getFormatDescEntry(format
, gl_info
);
145 UINT pow2_edge_length
;
150 /* TODO: It should only be possible to create textures for formats
151 * that are reported as supported. */
152 if (WINED3DFMT_UNKNOWN
>= format
)
154 WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture
);
155 return WINED3DERR_INVALIDCALL
;
158 if (!GL_SUPPORT(ARB_TEXTURE_CUBE_MAP
) && pool
!= WINED3DPOOL_SCRATCH
)
160 WARN("(%p) : Tried to create not supported cube texture.\n", texture
);
161 return WINED3DERR_INVALIDCALL
;
164 /* Calculate levels for mip mapping */
165 if (usage
& WINED3DUSAGE_AUTOGENMIPMAP
)
167 if (!GL_SUPPORT(SGIS_GENERATE_MIPMAP
))
169 WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
170 return WINED3DERR_INVALIDCALL
;
175 WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n");
176 return WINED3DERR_INVALIDCALL
;
183 levels
= wined3d_log2i(edge_length
) + 1;
184 TRACE("Calculated levels = %u.\n", levels
);
187 hr
= basetexture_init((IWineD3DBaseTextureImpl
*)texture
, levels
,
188 WINED3DRTYPE_CUBETEXTURE
, device
, 0, usage
, format_desc
, pool
, parent
);
191 WARN("Failed to initialize basetexture, returning %#x\n", hr
);
195 if (texture
->resource
.format_desc
->Flags
& WINED3DFMT_FLAG_FILTERING
)
197 texture
->baseTexture
.minMipLookup
= minMipLookup
;
198 texture
->baseTexture
.magLookup
= magLookup
;
202 texture
->baseTexture
.minMipLookup
= minMipLookup_noFilter
;
203 texture
->baseTexture
.magLookup
= magLookup_noFilter
;
206 /* Find the nearest pow2 match. */
207 pow2_edge_length
= 1;
208 while (pow2_edge_length
< edge_length
) pow2_edge_length
<<= 1;
210 if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO
) || (edge_length
== pow2_edge_length
))
212 /* Precalculated scaling for 'faked' non power of two texture coords. */
213 texture
->baseTexture
.pow2Matrix
[0] = 1.0f
;
214 texture
->baseTexture
.pow2Matrix
[5] = 1.0f
;
215 texture
->baseTexture
.pow2Matrix
[10] = 1.0f
;
216 texture
->baseTexture
.pow2Matrix
[15] = 1.0f
;
220 /* Precalculated scaling for 'faked' non power of two texture coords. */
221 texture
->baseTexture
.pow2Matrix
[0] = ((float)edge_length
) / ((float)pow2_edge_length
);
222 texture
->baseTexture
.pow2Matrix
[5] = ((float)edge_length
) / ((float)pow2_edge_length
);
223 texture
->baseTexture
.pow2Matrix
[10] = ((float)edge_length
) / ((float)pow2_edge_length
);
224 texture
->baseTexture
.pow2Matrix
[15] = 1.0f
;
225 texture
->baseTexture
.pow2Matrix_identity
= FALSE
;
228 /* Generate all the surfaces. */
230 for (i
= 0; i
< texture
->baseTexture
.levels
; ++i
)
232 /* Create the 6 faces. */
233 for (j
= 0; j
< 6; ++j
)
235 static const GLenum cube_targets
[6] =
237 GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
,
238 GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
,
239 GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
,
240 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
,
241 GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB
,
242 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
,
245 hr
= IWineD3DDeviceParent_CreateSurface(device
->device_parent
, parent
, tmp_w
, tmp_w
,
246 format
, usage
, pool
, i
/* Level */, j
, &texture
->surfaces
[j
][i
]);
249 FIXME("(%p) Failed to create surface, hr %#x.\n", texture
, hr
);
250 texture
->surfaces
[j
][i
] = NULL
;
251 cubetexture_cleanup(texture
, D3DCB_DefaultDestroySurface
);
255 IWineD3DSurface_SetContainer(texture
->surfaces
[j
][i
], (IWineD3DBase
*)texture
);
256 TRACE("Created surface level %u @ %p.\n", i
, texture
->surfaces
[j
][i
]);
257 surface_set_texture_target(texture
->surfaces
[j
][i
], cube_targets
[j
]);
259 tmp_w
= max(1, tmp_w
>> 1);
261 texture
->baseTexture
.internal_preload
= cubetexture_internal_preload
;
266 #undef GLINFO_LOCATION
268 /* *******************************************
269 IWineD3DCubeTexture IUnknown parts follow
270 ******************************************* */
272 #define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info
274 static HRESULT WINAPI
IWineD3DCubeTextureImpl_QueryInterface(IWineD3DCubeTexture
*iface
, REFIID riid
, LPVOID
*ppobj
)
276 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
277 TRACE("(%p)->(%s,%p)\n",This
,debugstr_guid(riid
),ppobj
);
278 if (IsEqualGUID(riid
, &IID_IUnknown
)
279 || IsEqualGUID(riid
, &IID_IWineD3DBase
)
280 || IsEqualGUID(riid
, &IID_IWineD3DResource
)
281 || IsEqualGUID(riid
, &IID_IWineD3DBaseTexture
)
282 || IsEqualGUID(riid
, &IID_IWineD3DCubeTexture
)) {
283 IUnknown_AddRef(iface
);
288 return E_NOINTERFACE
;
291 static ULONG WINAPI
IWineD3DCubeTextureImpl_AddRef(IWineD3DCubeTexture
*iface
) {
292 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
293 TRACE("(%p) : AddRef increasing from %d\n", This
, This
->resource
.ref
);
294 return InterlockedIncrement(&This
->resource
.ref
);
297 static ULONG WINAPI
IWineD3DCubeTextureImpl_Release(IWineD3DCubeTexture
*iface
) {
298 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
300 TRACE("(%p) : Releasing from %d\n", This
, This
->resource
.ref
);
301 ref
= InterlockedDecrement(&This
->resource
.ref
);
303 IWineD3DCubeTexture_Destroy(iface
, D3DCB_DefaultDestroySurface
);
308 /* ****************************************************
309 IWineD3DCubeTexture IWineD3DResource parts follow
310 **************************************************** */
311 static HRESULT WINAPI
IWineD3DCubeTextureImpl_GetDevice(IWineD3DCubeTexture
*iface
, IWineD3DDevice
** ppDevice
) {
312 return resource_get_device((IWineD3DResource
*)iface
, ppDevice
);
315 static HRESULT WINAPI
IWineD3DCubeTextureImpl_SetPrivateData(IWineD3DCubeTexture
*iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
) {
316 return resource_set_private_data((IWineD3DResource
*)iface
, refguid
, pData
, SizeOfData
, Flags
);
319 static HRESULT WINAPI
IWineD3DCubeTextureImpl_GetPrivateData(IWineD3DCubeTexture
*iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
) {
320 return resource_get_private_data((IWineD3DResource
*)iface
, refguid
, pData
, pSizeOfData
);
323 static HRESULT WINAPI
IWineD3DCubeTextureImpl_FreePrivateData(IWineD3DCubeTexture
*iface
, REFGUID refguid
) {
324 return resource_free_private_data((IWineD3DResource
*)iface
, refguid
);
327 static DWORD WINAPI
IWineD3DCubeTextureImpl_SetPriority(IWineD3DCubeTexture
*iface
, DWORD PriorityNew
) {
328 return resource_set_priority((IWineD3DResource
*)iface
, PriorityNew
);
331 static DWORD WINAPI
IWineD3DCubeTextureImpl_GetPriority(IWineD3DCubeTexture
*iface
) {
332 return resource_get_priority((IWineD3DResource
*)iface
);
335 static void WINAPI
IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture
*iface
) {
336 cubetexture_internal_preload((IWineD3DBaseTexture
*) iface
, SRGB_ANY
);
339 static void WINAPI
IWineD3DCubeTextureImpl_UnLoad(IWineD3DCubeTexture
*iface
) {
341 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
342 TRACE("(%p)\n", This
);
344 /* Unload all the surfaces and reset the texture name. If UnLoad was called on the
345 * surface before, this one will be a NOP and vice versa. Unloading an unloaded
348 for (i
= 0; i
< This
->baseTexture
.levels
; i
++) {
349 for (j
= WINED3DCUBEMAP_FACE_POSITIVE_X
; j
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
; j
++) {
350 IWineD3DSurface_UnLoad(This
->surfaces
[j
][i
]);
351 surface_set_texture_name(This
->surfaces
[j
][i
], 0, TRUE
);
352 surface_set_texture_name(This
->surfaces
[j
][i
], 0, FALSE
);
356 basetexture_unload((IWineD3DBaseTexture
*)iface
);
359 static WINED3DRESOURCETYPE WINAPI
IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTexture
*iface
) {
360 return resource_get_type((IWineD3DResource
*)iface
);
363 static HRESULT WINAPI
IWineD3DCubeTextureImpl_GetParent(IWineD3DCubeTexture
*iface
, IUnknown
**pParent
) {
364 return resource_get_parent((IWineD3DResource
*)iface
, pParent
);
367 /* ******************************************************
368 IWineD3DCubeTexture IWineD3DBaseTexture parts follow
369 ****************************************************** */
370 static DWORD WINAPI
IWineD3DCubeTextureImpl_SetLOD(IWineD3DCubeTexture
*iface
, DWORD LODNew
) {
371 return basetexture_set_lod((IWineD3DBaseTexture
*)iface
, LODNew
);
374 static DWORD WINAPI
IWineD3DCubeTextureImpl_GetLOD(IWineD3DCubeTexture
*iface
) {
375 return basetexture_get_lod((IWineD3DBaseTexture
*)iface
);
378 static DWORD WINAPI
IWineD3DCubeTextureImpl_GetLevelCount(IWineD3DCubeTexture
*iface
) {
379 return basetexture_get_level_count((IWineD3DBaseTexture
*)iface
);
382 static HRESULT WINAPI
IWineD3DCubeTextureImpl_SetAutoGenFilterType(IWineD3DCubeTexture
*iface
, WINED3DTEXTUREFILTERTYPE FilterType
) {
383 return basetexture_set_autogen_filter_type((IWineD3DBaseTexture
*)iface
, FilterType
);
386 static WINED3DTEXTUREFILTERTYPE WINAPI
IWineD3DCubeTextureImpl_GetAutoGenFilterType(IWineD3DCubeTexture
*iface
) {
387 return basetexture_get_autogen_filter_type((IWineD3DBaseTexture
*)iface
);
390 static void WINAPI
IWineD3DCubeTextureImpl_GenerateMipSubLevels(IWineD3DCubeTexture
*iface
) {
391 basetexture_generate_mipmaps((IWineD3DBaseTexture
*)iface
);
394 /* Internal function, No d3d mapping */
395 static BOOL WINAPI
IWineD3DCubeTextureImpl_SetDirty(IWineD3DCubeTexture
*iface
, BOOL dirty
) {
396 return basetexture_set_dirty((IWineD3DBaseTexture
*)iface
, dirty
);
399 /* Internal function, No d3d mapping */
400 static BOOL WINAPI
IWineD3DCubeTextureImpl_GetDirty(IWineD3DCubeTexture
*iface
) {
401 return basetexture_get_dirty((IWineD3DBaseTexture
*)iface
);
404 /* Context activation is done by the caller. */
405 static HRESULT WINAPI
IWineD3DCubeTextureImpl_BindTexture(IWineD3DCubeTexture
*iface
, BOOL srgb
) {
406 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
407 BOOL set_gl_texture_desc
;
410 TRACE("(%p) : relay to BaseTexture\n", This
);
412 hr
= basetexture_bind((IWineD3DBaseTexture
*)iface
, srgb
, &set_gl_texture_desc
);
413 if (set_gl_texture_desc
&& SUCCEEDED(hr
)) {
415 for (i
= 0; i
< This
->baseTexture
.levels
; ++i
) {
416 for (j
= WINED3DCUBEMAP_FACE_POSITIVE_X
; j
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
; ++j
) {
417 if(This
->baseTexture
.is_srgb
) {
418 surface_set_texture_name(This
->surfaces
[j
][i
], This
->baseTexture
.srgbTextureName
, TRUE
);
420 surface_set_texture_name(This
->surfaces
[j
][i
], This
->baseTexture
.textureName
, FALSE
);
429 static UINT WINAPI
IWineD3DCubeTextureImpl_GetTextureDimensions(IWineD3DCubeTexture
*iface
){
430 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
431 TRACE("(%p)\n", This
);
433 return GL_TEXTURE_CUBE_MAP_ARB
;
436 static BOOL WINAPI
IWineD3DCubeTextureImpl_IsCondNP2(IWineD3DCubeTexture
*iface
) {
437 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
438 TRACE("(%p)\n", This
);
443 /* *******************************************
444 IWineD3DCubeTexture IWineD3DCubeTexture parts follow
445 ******************************************* */
446 static void WINAPI
IWineD3DCubeTextureImpl_Destroy(IWineD3DCubeTexture
*iface
, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface
) {
447 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
449 cubetexture_cleanup(This
, D3DCB_DestroySurface
);
450 /* finally delete the object */
451 HeapFree(GetProcessHeap(), 0, This
);
454 static HRESULT WINAPI
IWineD3DCubeTextureImpl_GetLevelDesc(IWineD3DCubeTexture
*iface
, UINT Level
, WINED3DSURFACE_DESC
* pDesc
) {
455 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
457 if (Level
< This
->baseTexture
.levels
) {
458 TRACE("(%p) level (%d)\n", This
, Level
);
459 return IWineD3DSurface_GetDesc(This
->surfaces
[0][Level
], pDesc
);
461 WARN("(%p) level(%d) overflow Levels(%d)\n", This
, Level
, This
->baseTexture
.levels
);
462 return WINED3DERR_INVALIDCALL
;
465 static HRESULT WINAPI
IWineD3DCubeTextureImpl_GetCubeMapSurface(IWineD3DCubeTexture
*iface
, WINED3DCUBEMAP_FACES FaceType
, UINT Level
, IWineD3DSurface
** ppCubeMapSurface
) {
466 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
467 HRESULT hr
= WINED3DERR_INVALIDCALL
;
469 if (Level
< This
->baseTexture
.levels
&& FaceType
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
) {
470 *ppCubeMapSurface
= This
->surfaces
[FaceType
][Level
];
471 IWineD3DSurface_AddRef(*ppCubeMapSurface
);
475 if (WINED3D_OK
== hr
) {
476 TRACE("(%p) -> faceType(%d) level(%d) returning surface@%p\n", This
, FaceType
, Level
, This
->surfaces
[FaceType
][Level
]);
478 WARN("(%p) level(%d) overflow Levels(%d) Or FaceType(%d)\n", This
, Level
, This
->baseTexture
.levels
, FaceType
);
484 static HRESULT WINAPI
IWineD3DCubeTextureImpl_LockRect(IWineD3DCubeTexture
*iface
, WINED3DCUBEMAP_FACES FaceType
, UINT Level
, WINED3DLOCKED_RECT
* pLockedRect
, CONST RECT
* pRect
, DWORD Flags
) {
485 HRESULT hr
= WINED3DERR_INVALIDCALL
;
486 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
488 if (Level
< This
->baseTexture
.levels
&& FaceType
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
) {
489 hr
= IWineD3DSurface_LockRect(This
->surfaces
[FaceType
][Level
], pLockedRect
, pRect
, Flags
);
492 if (WINED3D_OK
== hr
) {
493 TRACE("(%p) -> faceType(%d) level(%d) returning memory@%p success(%u)\n", This
, FaceType
, Level
, pLockedRect
->pBits
, hr
);
495 WARN("(%p) level(%d) overflow Levels(%d) Or FaceType(%d)\n", This
, Level
, This
->baseTexture
.levels
, FaceType
);
501 static HRESULT WINAPI
IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture
*iface
, WINED3DCUBEMAP_FACES FaceType
, UINT Level
) {
502 HRESULT hr
= WINED3DERR_INVALIDCALL
;
503 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
505 if (Level
< This
->baseTexture
.levels
&& FaceType
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
) {
506 hr
= IWineD3DSurface_UnlockRect(This
->surfaces
[FaceType
][Level
]);
509 if (WINED3D_OK
== hr
) {
510 TRACE("(%p) -> faceType(%d) level(%d) success(%u)\n", This
, FaceType
, Level
, hr
);
512 WARN("(%p) level(%d) overflow Levels(%d) Or FaceType(%d)\n", This
, Level
, This
->baseTexture
.levels
, FaceType
);
517 static HRESULT WINAPI
IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture
*iface
, WINED3DCUBEMAP_FACES FaceType
, CONST RECT
* pDirtyRect
) {
518 HRESULT hr
= WINED3DERR_INVALIDCALL
;
519 IWineD3DCubeTextureImpl
*This
= (IWineD3DCubeTextureImpl
*)iface
;
520 This
->baseTexture
.dirty
= TRUE
;
521 This
->baseTexture
.srgbDirty
= TRUE
;
522 TRACE("(%p) : dirtyfication of faceType(%d) Level (0)\n", This
, FaceType
);
523 if (FaceType
<= WINED3DCUBEMAP_FACE_NEGATIVE_Z
) {
524 surface_add_dirty_rect(This
->surfaces
[FaceType
][0], pDirtyRect
);
527 WARN("(%p) overflow FaceType(%d)\n", This
, FaceType
);
533 const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl
=
536 IWineD3DCubeTextureImpl_QueryInterface
,
537 IWineD3DCubeTextureImpl_AddRef
,
538 IWineD3DCubeTextureImpl_Release
,
539 /* IWineD3DResource */
540 IWineD3DCubeTextureImpl_GetParent
,
541 IWineD3DCubeTextureImpl_GetDevice
,
542 IWineD3DCubeTextureImpl_SetPrivateData
,
543 IWineD3DCubeTextureImpl_GetPrivateData
,
544 IWineD3DCubeTextureImpl_FreePrivateData
,
545 IWineD3DCubeTextureImpl_SetPriority
,
546 IWineD3DCubeTextureImpl_GetPriority
,
547 IWineD3DCubeTextureImpl_PreLoad
,
548 IWineD3DCubeTextureImpl_UnLoad
,
549 IWineD3DCubeTextureImpl_GetType
,
550 /* IWineD3DBaseTexture */
551 IWineD3DCubeTextureImpl_SetLOD
,
552 IWineD3DCubeTextureImpl_GetLOD
,
553 IWineD3DCubeTextureImpl_GetLevelCount
,
554 IWineD3DCubeTextureImpl_SetAutoGenFilterType
,
555 IWineD3DCubeTextureImpl_GetAutoGenFilterType
,
556 IWineD3DCubeTextureImpl_GenerateMipSubLevels
,
557 IWineD3DCubeTextureImpl_SetDirty
,
558 IWineD3DCubeTextureImpl_GetDirty
,
559 IWineD3DCubeTextureImpl_BindTexture
,
560 IWineD3DCubeTextureImpl_GetTextureDimensions
,
561 IWineD3DCubeTextureImpl_IsCondNP2
,
562 /* IWineD3DCubeTexture */
563 IWineD3DCubeTextureImpl_Destroy
,
564 IWineD3DCubeTextureImpl_GetLevelDesc
,
565 IWineD3DCubeTextureImpl_GetCubeMapSurface
,
566 IWineD3DCubeTextureImpl_LockRect
,
567 IWineD3DCubeTextureImpl_UnlockRect
,
568 IWineD3DCubeTextureImpl_AddDirtyRect