add support for high res brush textures, implement mipmaps on brush

This commit is contained in:
2017-09-30 16:35:12 +01:00
parent 763e446cc5
commit 964795b44d
17 changed files with 61 additions and 20 deletions

View File

@@ -18,6 +18,7 @@ public:
void unbind() const { glBindTexture(GL_TEXTURE_2D, 0); }
void update(const uint8_t* data);
bool ready() const { return m_tex != 0; }
void create_mipmaps();
glm::vec2 size() const;
};
@@ -28,6 +29,7 @@ class Sampler
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);
void set_filter(GLint filter_min, GLint filter_mag);
void bind(int unit);
void unbind();
bool ready() const { return id != 0; }
@@ -37,7 +39,7 @@ class TextureManager
{
public:
static std::map<uint16_t, Texture2D> m_textures;
static bool load(const char* path);
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 Texture2D& get(uint16_t id);
static void invalidate();