Created
December 22, 2014 18:50
-
-
Save bgK/d300ccdcef2048c13aea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/engines/myst3/gfx_opengl_texture.cpp b/engines/myst3/gfx_opengl_texture.cpp | |
index 6f855ca..558ebd7 100644 | |
--- a/engines/myst3/gfx_opengl_texture.cpp | |
+++ b/engines/myst3/gfx_opengl_texture.cpp | |
@@ -56,7 +56,7 @@ OpenGLTexture::OpenGLTexture(const Graphics::Surface *surface, bool nonPoTSuppor | |
if (format.bytesPerPixel == 4) { | |
internalFormat = GL_RGBA; | |
- sourceFormat = GL_UNSIGNED_BYTE; | |
+ sourceFormat = GL_UNSIGNED_INT_8_8_8_8_REV; | |
} else if (format.bytesPerPixel == 2) { | |
internalFormat = GL_RGB; | |
sourceFormat = GL_UNSIGNED_SHORT_5_6_5; | |
@@ -83,6 +83,7 @@ OpenGLTexture::~OpenGLTexture() { | |
void OpenGLTexture::update(const Graphics::Surface *surface) { | |
glBindTexture(GL_TEXTURE_2D, id); | |
+ | |
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, surface->w, surface->h, internalFormat, sourceFormat, surface->getPixels()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment