-
Notifications
You must be signed in to change notification settings - Fork 0
/
texture.hpp
43 lines (37 loc) · 1.04 KB
/
texture.hpp
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
/*
* texture.hpp
* Texture definition
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <[email protected]> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return Clement Decoodt
* ----------------------------------------------------------------------------
*/
#pragma once
#include <GL/gl.h>
#include <string>
#include <vector>
#include <iostream>
namespace texture {
class Texture {
public:
Texture(std::string filename) {
this->filename = filename;
open();
}
void setId(GLuint id) {this->id = id; }
unsigned char* getImage() { return image; };
GLuint getId() { return id; };
int getWidth() { return width; };
int getHeight() { return height;};
protected:
void open();
private:
GLuint id;
std::string magicNum;
std::string filename;
int width, height;
unsigned char *image;
};
}