aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-19 20:25:07 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-19 20:25:07 +0200
commit17254ca13ce7985e87a413df1d8546779734f05e (patch)
treef32750de0d1a1922b29df912e3fbdc2d63ccb6d3 /src
parent954a4e72071da0e121c427d821e5009951d5ce13 (diff)
Implement c++ version of mgl_texture_init_reference_existing_gl_texture
Diffstat (limited to 'src')
-rw-r--r--src/graphics/Texture.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/graphics/Texture.cpp b/src/graphics/Texture.cpp
index 0c4b7fc..3b1f410 100644
--- a/src/graphics/Texture.cpp
+++ b/src/graphics/Texture.cpp
@@ -7,6 +7,14 @@ namespace mgl {
memset(&texture, 0, sizeof(mgl_texture));
}
+ Texture::Texture(unsigned int gl_texture_id, mgl_texture_format format, const ReferenceOptions reference_options) {
+ memset(&texture, 0, sizeof(mgl_texture));
+ const mgl_texture_reference_options texture_reference_options = {
+ reference_options.pixel_coordinates
+ };
+ mgl_texture_init_reference_existing_gl_texture(&texture, gl_texture_id, format, &texture_reference_options);
+ }
+
Texture::Texture(Texture &&other) {
memcpy(&texture, &other.texture, sizeof(mgl_texture));
owned = other.owned;