-
Notifications
You must be signed in to change notification settings - Fork 0
/
Texture.h
37 lines (26 loc) · 797 Bytes
/
Texture.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _ctexture_h
#define _ctexture_h
#include "base.h"
class CTexture
{
LPDIRECT3DDEVICE9 m_pDevice;
LPDIRECT3DTEXTURE9 m_pTexture;
D3DLOCKED_RECT m_LockedRect;
D3DSURFACE_DESC m_Desc;
int m_Width, m_Height;
public:
LPDIRECT3DDEVICE9 GetDevice() { assert(m_pDevice); return m_pDevice; };
HRESULT CreateTextureFromFile(LPDIRECT3DDEVICE9 pDevice, const char *pTextureName, const int ColourKey = 0,
const int Width = 0, const int Height = 0);
HRESULT CreateTexture(LPDIRECT3DDEVICE9 pDevice, const int Width, const int Height);
void GenerateMipLevels();
void* Lock();
void Unlock();
void SetTexture(const int Stage);
LPDIRECT3DTEXTURE9 GetTexture();
int GetWidth() { return m_Width; };
int GetHeight() { return m_Height; };
CTexture();
~CTexture();
};
#endif