-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTexture.h
More file actions
55 lines (42 loc) · 1.45 KB
/
Copy pathTexture.h
File metadata and controls
55 lines (42 loc) · 1.45 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// ===========================================================================
/// <summary>
/// Texture.h
/// DirectXIntroduction
/// created by Mehrdad Soleimanimajd on 28.08.2019
/// </summary>
/// <created>ʆϒʅ, 28.08.2019</created>
/// <changed>ʆϒʅ, 04.07.2023</changed>
// ===========================================================================
#ifndef TEXTURE_H
#define TEXTURE_H
#include <d3d10_1.h>
// targa texture file type
struct TargaHeader
{
unsigned char dataOne [12];
unsigned short width;
unsigned short height;
unsigned char bpp; // bit per pixel
unsigned short dataTwo;
};
// png texture file typev
struct PngHeader {};
// operations on textures wrapper
template <typename fileType>
class Texture
{
private:
ID3D10Device1* device;
fileType file; // different file formats
unsigned char* data; // raw file data holder
ID3D10Texture2D* texture; // structured texture data, rendered by DirectX
ID3D10ShaderResourceView* textureView; // resource view, holder of texture data drawn by shader
bool Load (const char*); // specialized defined file loader
public:
Texture (ID3D10Device1*, const char*);
ID3D10ShaderResourceView** const getTexture (void); // get texture data (unsuccessful texture file loading: nullptr)
void release (void); // resource releaser
};
void TextureClassLinker (void); // don't call this function: solution for linker error, when using templates.
#endif // !TEXTURE_H