-
Notifications
You must be signed in to change notification settings - Fork 3
/
GLTexture.h
28 lines (22 loc) · 704 Bytes
/
GLTexture.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
#pragma once
#include <string>
#include <memory>
#include <nanogui/opengl.h>
class cGLTexture {
public:
using handleType = std::unique_ptr<uint8_t[], void(*)(void*)>;
cGLTexture() = default;
cGLTexture(const std::string& textureName);
cGLTexture(const std::string& textureName, GLint textureId);
cGLTexture(const cGLTexture& other) = delete;
cGLTexture(cGLTexture&& other) noexcept;
cGLTexture& operator=(const cGLTexture& other) = delete;
cGLTexture& operator=(cGLTexture&& other) noexcept;
~cGLTexture() noexcept;
GLuint texture() const;
const std::string& textureName() const;
handleType load(const std::string& fileName);
protected:
std::string mTextureName;
GLuint mTextureId;
};