aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-04-14 23:16:43 +0200
committerdec05eba <dec05eba@protonmail.com>2025-04-14 23:16:43 +0200
commit0c90a62d08ef8846b2516342f7a3ded10415f3bf (patch)
tree8883804c783d5c9222be1cd2240aaa5c453995de /include
parent7d6e67668ba317d823f58f9bd8edbea2da9f4b68 (diff)
Add scaling option for texture, allow nearest neighbour scaling
Diffstat (limited to 'include')
-rw-r--r--include/mglpp/graphics/Texture.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/mglpp/graphics/Texture.hpp b/include/mglpp/graphics/Texture.hpp
index 1ea040e..6ab1fb4 100644
--- a/include/mglpp/graphics/Texture.hpp
+++ b/include/mglpp/graphics/Texture.hpp
@@ -14,24 +14,25 @@ namespace mgl {
struct LoadOptions {
bool compressed = false;
bool pixel_coordinates = false;
- bool mipmap = false; /* available since opengl 3.0 */
+ mgl_texture_scale_type scale_type = MGL_TEXTURE_SCALE_LINEAR;
};
struct ReferenceOptions {
bool pixel_coordinates = false;
+ mgl_texture_scale_type scale_type = MGL_TEXTURE_SCALE_LINEAR;
};
Texture();
- Texture(unsigned int gl_texture_id, mgl_texture_format format, const ReferenceOptions reference_options = {false});
+ Texture(unsigned int gl_texture_id, mgl_texture_format format, const ReferenceOptions reference_options = {false, MGL_TEXTURE_SCALE_LINEAR});
Texture(Texture &&other);
Texture& operator=(Texture &&other);
~Texture();
static Texture reference(mgl_texture ref);
- bool load_from_file(const char *filepath, const LoadOptions load_options = {false, false, false});
- bool load_from_image(Image &image, const LoadOptions load_options = {false, false, false});
- bool load_from_memory(const unsigned char *data, int width, int height, mgl_image_format format, LoadOptions load_options = {false, false, false});
+ bool load_from_file(const char *filepath, const LoadOptions load_options = {false, false, MGL_TEXTURE_SCALE_LINEAR});
+ bool load_from_image(Image &image, const LoadOptions load_options = {false, false, MGL_TEXTURE_SCALE_LINEAR});
+ bool load_from_memory(const unsigned char *data, int width, int height, mgl_image_format format, LoadOptions load_options = {false, false, MGL_TEXTURE_SCALE_LINEAR});
void clear();
vec2i get_size() const;
bool is_valid() const;