-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTexture.h
executable file
·68 lines (58 loc) · 1.6 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include "opengl.h"
#include <iostream>
/**
* Represent a texture, give faces of a Mesh some image
*/
class Texture {
private:
/**
* Buffer used by OpenGL to keep the Texture
*/
GLuint imageId;
public:
/**
* Construct an useless Texture but still valid
*/
Texture();
/**
* Remove the copy constructor
*/
Texture(const Texture&) = delete;
/**
* Move constructor, leave texture in a useless but valid
* state
*
* \param texture Texture to move from
*/
Texture(Texture&& texture);
/**
* Construct with every needed info
*
* It will copy the given buffer into GRAM
*
* \param width Width of the image
* \param height Height of the image
* \param format Pixel format of the image
* \param buffer Buffer containing the image
*/
Texture(const unsigned short width, const unsigned short height,
const GLenum format, unsigned char* buffer);
/**
* Bind the Texture to use it with OpenGL
*/
void bindTexture() const;
/**
* Give a sorting capability
*
* \param b Texture to compare to
*
* \return True if the local \ref imageId is less than the one
* of b
*/
bool operator<(const Texture &b) const;
/**
* Destruct the Texture, delete his buffer
*/
~Texture();
};