jes-ruby/src/GLTexture.h

27 lines
587 B
C++

#ifndef GLTEXTURE_H
#define GLTEXTURE_H
#include "Ref.h"
#include "gl3w.h"
#include <stdint.h>
class GLTexture
{
public:
GLTexture();
~GLTexture();
GLuint get_id() { return m_id; }
void bind() { glBindTexture(GL_TEXTURE_2D, m_id); }
static uint32_t next_power_of_2(uint32_t n);
void create(unsigned int width, unsigned int height);
unsigned int get_width() { return m_width; }
unsigned int get_height() { return m_height; }
protected:
GLuint m_id;
unsigned int m_width;
unsigned int m_height;
};
typedef Ref<GLTexture> GLTextureRef;
#endif