-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTexture.h
40 lines (35 loc) · 898 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
38
39
40
#ifndef TEXTURE_H
#define TEXTURE_H
#include <string>
#include <windows.h>
#include <windowsx.h>
#include <d3d10.h>
#include <d3dx10.h>
#include "Utils.h"
using namespace std;
class Texture
{
private:
ID3D10Device* device;
ID3D10Effect* effect;
D3D10_TEXTURE2D_DESC desc_texture;
ID3D10Texture2D* tex_texture;
ID3D10ShaderResourceView* srv_texture;
ID3D10EffectShaderResourceVariable* fxVar_texture;
string resourceFolder;
string texFileName;
string texVarName;
public:
Texture();
~Texture();
void clear();
void setDeviceAndFx(ID3D10Device* _device, ID3D10Effect* _effect);
void setTexture(string _resourceFolder, string _textureName);
void setShaderTargets(string _texVarName);
void setDynamic(int _width, int _height);
void setPixel(const byte* _source, int _x, int _y);
void setAllPixels(const byte* _source);
void initTexture();
void useTexture();
};
#endif //TEXTURE_H