minor changes and added namespace to avoid conflicts when integrating with PanoPainter
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "image.h"
|
||||
|
||||
class Texture2D
|
||||
{
|
||||
@@ -8,7 +9,8 @@ class Texture2D
|
||||
GLint m_format;
|
||||
public:
|
||||
bool create(int width, int height, GLint format = GL_RGBA, const uint8_t* data = nullptr);
|
||||
bool create(const class Image& img);
|
||||
bool create(const ui::Image& img);
|
||||
void assign(GLuint tex, int w = -1, int h = -1, GLuint format = GL_RGBA);
|
||||
bool load(std::string filename);
|
||||
void destroy() { glDeleteTextures(1, &m_tex); }
|
||||
void bind() const { glBindTexture(GL_TEXTURE_2D, m_tex); }
|
||||
@@ -35,5 +37,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 Texture2D& get(uint16_t id);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user