mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
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.
This commit is contained in:
parent
fde0045ebe
commit
755393e684
8 changed files with 85 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue