diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-07-31 20:56:23 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-07-31 20:56:29 +0200 |
commit | be41f208c6660a879818321e2904795c7d45fe3e (patch) | |
tree | 18b609910be3ca02cfbc6928d8db7c6afd0972f8 /include | |
parent | 6c79d44732272b4d8a28abe89a78692a6b7c5cc4 (diff) |
Add mipmap, texture load from memory
Diffstat (limited to 'include')
-rw-r--r-- | include/mglpp/graphics/Texture.hpp | 10 | ||||
-rw-r--r-- | include/mglpp/system/MemoryMappedFile.hpp | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/mglpp/graphics/Texture.hpp b/include/mglpp/graphics/Texture.hpp index 906818c..8bd2df6 100644 --- a/include/mglpp/graphics/Texture.hpp +++ b/include/mglpp/graphics/Texture.hpp @@ -12,8 +12,9 @@ namespace mgl { class Texture { public: struct LoadOptions { - bool compressed; - bool pixel_coordinates; + bool compressed = false; + bool pixel_coordinates = false; + bool mipmap = false; /* available since opengl 3.0 */ }; Texture(); @@ -23,8 +24,9 @@ namespace mgl { static Texture reference(mgl_texture ref); - bool load_from_file(const char *filepath, const LoadOptions load_options = {false, false}); - bool load_from_image(Image &image, const LoadOptions load_options = {false, false}); + 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}); void clear(); vec2i get_size() const; bool is_valid() const; diff --git a/include/mglpp/system/MemoryMappedFile.hpp b/include/mglpp/system/MemoryMappedFile.hpp index 1be23d4..57f3c67 100644 --- a/include/mglpp/system/MemoryMappedFile.hpp +++ b/include/mglpp/system/MemoryMappedFile.hpp @@ -9,8 +9,8 @@ namespace mgl { class MemoryMappedFile { public: struct LoadOptions { - bool readable; - bool writable; + bool readable = true; + bool writable = true; }; MemoryMappedFile(); |