Move texture defaults behind renderer gl
This commit is contained in:
@@ -17,9 +17,12 @@ public:
|
||||
~Texture2D();
|
||||
|
||||
bool has_mips = false;
|
||||
bool create(int width, int height, GLint internal_format = GL_RGBA8, GLint format = GL_RGBA, const uint8_t* data = nullptr);
|
||||
bool create(int width, int height);
|
||||
bool create(int width, int height, GLint internal_format);
|
||||
bool create(int width, int height, GLint internal_format, GLint format, const uint8_t* data = nullptr);
|
||||
bool create(const Image& img);
|
||||
void assign(GLuint tex, int w = -1, int h = -1, GLuint internal_format = GL_RGBA8, GLuint format = GL_RGBA);
|
||||
void assign(GLuint tex, int w = -1, int h = -1);
|
||||
void assign(GLuint tex, int w, int h, GLuint internal_format, GLuint format);
|
||||
bool load(std::string filename);
|
||||
bool load_file(std::string filename);
|
||||
void destroy();
|
||||
@@ -57,8 +60,12 @@ class Sampler
|
||||
GLuint id = 0;
|
||||
mutable GLint current_unit = 0;
|
||||
public:
|
||||
bool create(GLint filter = GL_LINEAR, GLint wrap = GL_CLAMP_TO_EDGE);
|
||||
void set(GLint filter = GL_LINEAR, GLint wrap = GL_CLAMP_TO_EDGE);
|
||||
bool create();
|
||||
bool create(GLint filter);
|
||||
bool create(GLint filter, GLint wrap);
|
||||
void set();
|
||||
void set(GLint filter);
|
||||
void set(GLint filter, GLint wrap);
|
||||
void set_filter(GLint filter_min, GLint filter_mag);
|
||||
void set_border(glm::vec4 rgba);
|
||||
void bind(int unit) const;
|
||||
@@ -71,7 +78,8 @@ class TextureManager
|
||||
public:
|
||||
static std::map<uint16_t, Texture2D> m_textures;
|
||||
static bool load(const char* path, bool generate_mipmpas = false);
|
||||
static void assign(uint16_t id, GLuint tex, int w = -1, int h = -1, GLuint internal_format = GL_RGBA8, GLuint format = GL_RGBA);
|
||||
static void assign(uint16_t id, GLuint tex, int w = -1, int h = -1);
|
||||
static void assign(uint16_t id, GLuint tex, int w, int h, GLuint internal_format, GLuint format);
|
||||
static Texture2D& get(uint16_t id);
|
||||
static void invalidate();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user