1 /*
2 * Copyright 2011 Joakim Sindholt <[email protected]>
3 * SPDX-License-Identifier: MIT
4 */
5
6 #ifndef _NINE_CUBETEXTURE9_H_
7 #define _NINE_CUBETEXTURE9_H_
8
9 #include "basetexture9.h"
10 #include "nine_memory_helper.h"
11 #include "surface9.h"
12
13 struct NineCubeTexture9
14 {
15 struct NineBaseTexture9 base;
16 struct NineSurface9 **surfaces;
17 struct pipe_box dirty_rect[6]; /* covers all mip levels */
18 struct nine_allocation *managed_buffer;
19 };
20 static inline struct NineCubeTexture9 *
NineCubeTexture9(void * data)21 NineCubeTexture9( void *data )
22 {
23 return (struct NineCubeTexture9 *)data;
24 }
25
26 HRESULT
27 NineCubeTexture9_new( struct NineDevice9 *pDevice,
28 UINT EdgeLength, UINT Levels,
29 DWORD Usage,
30 D3DFORMAT Format,
31 D3DPOOL Pool,
32 struct NineCubeTexture9 **ppOut,
33 HANDLE *pSharedHandle );
34
35 HRESULT NINE_WINAPI
36 NineCubeTexture9_GetLevelDesc( struct NineCubeTexture9 *This,
37 UINT Level,
38 D3DSURFACE_DESC *pDesc );
39
40 HRESULT NINE_WINAPI
41 NineCubeTexture9_GetCubeMapSurface( struct NineCubeTexture9 *This,
42 D3DCUBEMAP_FACES FaceType,
43 UINT Level,
44 IDirect3DSurface9 **ppCubeMapSurface );
45
46 HRESULT NINE_WINAPI
47 NineCubeTexture9_LockRect( struct NineCubeTexture9 *This,
48 D3DCUBEMAP_FACES FaceType,
49 UINT Level,
50 D3DLOCKED_RECT *pLockedRect,
51 const RECT *pRect,
52 DWORD Flags );
53
54 HRESULT NINE_WINAPI
55 NineCubeTexture9_UnlockRect( struct NineCubeTexture9 *This,
56 D3DCUBEMAP_FACES FaceType,
57 UINT Level );
58
59 HRESULT NINE_WINAPI
60 NineCubeTexture9_AddDirtyRect( struct NineCubeTexture9 *This,
61 D3DCUBEMAP_FACES FaceType,
62 const RECT *pDirtyRect );
63
64 #endif /* _NINE_CUBETEXTURE9_H_ */
65