summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@serenityos.org>2021-05-30 00:15:51 +0200
committerLinus Groh <mail@linusgroh.de>2021-05-30 00:32:37 +0100
commit755393e684268b8ee1c1f72b6a705e99827836b5 (patch)
tree6e2f552d4908db497931ef855ffc31a0f5fffe7a /Userland/Applications
parentfde0045ebe7ac5aa1698870002ae58edac3c4f85 (diff)
downloadserenity-755393e684268b8ee1c1f72b6a705e99827836b5.zip
LibGL: Implement glBindTexture()
Textures are now initialized with a nullptr upon generation. They are only actually created once they are bound to a target. Currently only the GL_TEXTURE_2D target is supported. The software rasterizer now allows rendering with or without a bound TEXTURE_2D.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/3DFileViewer/main.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp
index 177e181637..1a98418403 100644
--- a/Userland/Applications/3DFileViewer/main.cpp
+++ b/Userland/Applications/3DFileViewer/main.cpp
@@ -153,6 +153,7 @@ bool GLContextWidget::load(const String& filename)
glGenTextures(1, &tex);
if (texture_image) {
// Upload texture data to the GL
+ glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texture_image->width(), texture_image->height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_image->scanline(0));
} else {
dbgln("3DFileViewer: Couldn't load texture for {}", filename);