aboutsummaryrefslogtreecommitdiff
path: root/src/ogl.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2025-04-24 12:25:33 -0700
committerrtk0c <[email protected]>2025-04-24 12:25:33 -0700
commitd5fd02d8eb387b477678ffbfb44303a38c105607 (patch)
treeef706d91dbcd8cd345034e791b7be9076d0897a8 /src/ogl.cpp
parent75585f4fb6f312195a47b16224d45e671858dac7 (diff)
Some draft ideas on simulation
Diffstat (limited to 'src/ogl.cpp')
-rw-r--r--src/ogl.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ogl.cpp b/src/ogl.cpp
new file mode 100644
index 0000000..a7b2dfa
--- /dev/null
+++ b/src/ogl.cpp
@@ -0,0 +1,16 @@
+#include "ogl.hpp"
+
+#include <imgui_impl_opengl3_loader.h>
+
+OglImage::OglImage() {
+ glGenTextures(1, &glHandle);
+}
+
+OglImage::~OglImage() {
+ glDeleteTextures(1, &glHandle);
+}
+
+void OglImage::upload(const char* data, int w, int h) {
+ glBindTexture(GL_TEXTURE_2D, glHandle);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
+}