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