Android opengl debug callback, Android device properties, fix texture internal format

This commit is contained in:
2017-04-02 11:35:11 +01:00
parent b1a3cb0309
commit 0dfb458c71
9 changed files with 135 additions and 35 deletions

View File

@@ -7,10 +7,11 @@ class Texture2D
int m_width;
int m_height;
GLint m_format;
GLint m_iformat;
public:
bool create(int width, int height, GLint format = GL_RGBA, const uint8_t* data = nullptr);
bool create(int width, int height, GLint internal_format, GLint format = GL_RGBA, const uint8_t* data = nullptr);
bool create(const ui::Image& img);
void assign(GLuint tex, int w = -1, int h = -1, GLuint format = GL_RGBA);
void assign(GLuint tex, int w = -1, int h = -1, GLuint internal_format = GL_RGBA8, GLuint format = GL_RGBA);
bool load(std::string filename);
void destroy() { glDeleteTextures(1, &m_tex); }
void bind() const { glBindTexture(GL_TEXTURE_2D, m_tex); }
@@ -37,6 +38,6 @@ class TextureManager
public:
static std::map<uint16_t, Texture2D> m_textures;
static bool load(const char* path);
static void assign(uint16_t id, GLuint tex, int w = -1, int h = -1, GLuint format = GL_RGBA);
static void assign(uint16_t id, GLuint tex, int w = -1, int h = -1, GLuint internal_format = GL_RGBA8, GLuint format = GL_RGBA);
static Texture2D& get(uint16_t id);
};