Unified opengl textures

This commit is contained in:
Enrico Turri 2018-07-18 15:07:52 +02:00
parent b69e23ce73
commit 3fac0d92cd
4 changed files with 501 additions and 220 deletions

View file

@ -10,7 +10,10 @@ namespace GUI {
class GLTexture
{
private:
//###################################################################################################################################################
protected:
// private:
//###################################################################################################################################################
unsigned int m_id;
int m_width;
int m_height;
@ -18,7 +21,10 @@ namespace GUI {
public:
GLTexture();
~GLTexture();
//###################################################################################################################################################
virtual ~GLTexture();
// ~GLTexture();
//###################################################################################################################################################
bool load_from_file(const std::string& filename, bool generate_mipmaps);
void reset();
@ -26,11 +32,15 @@ namespace GUI {
unsigned int get_id() const;
int get_width() const;
int get_height() const;
const std::string& get_source() const;
static void render_texture(unsigned int tex_id, float left, float right, float bottom, float top);
private:
//###################################################################################################################################################
protected:
// private:
//###################################################################################################################################################
void _generate_mipmaps(wxImage& image);
};