-
Notifications
You must be signed in to change notification settings - Fork 1
/
texture.h
36 lines (28 loc) · 910 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
#ifndef TAK__TEXTURE_H__
#define TAK__TEXTURE_H__
#include "define.h"
#include "resource.h"
#include <IL/il.h>
#include <string>
class Texture : public Resource<Texture>
{
public:
Texture();
~Texture();
virtual bool Load(const std::string& key, const OptionList& options);
virtual bool Release();
bool LoadFromMemoryRGBA(const std::string& name, const uint8* data, int width, int height, bool mipmap = true);
bool IsValid() const;
void Bind() const;
uint GetTextureId() const;
std::string GetTextureName() const;
bool operator==(const Texture& texture) const;
bool operator!=(const Texture& texture) const;
private:
bool Load(const std::string& filename, bool mipmap);
private:
GLuint m_textureId;
std::string m_textureName;
bool m_isValid;
};
#endif // TEXTURE_H__