diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 46: Use only values allowed by OpenGL ES 2.0 for the internalFormat in glTexImage2D().

Message ID 20110721123633.17019.19210.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Alexandros Frantzis July 21, 2011, 12:36 p.m. UTC
------------------------------------------------------------
revno: 46
committer: Alexandros Frantzis <alf82@freemail.gr>
timestamp: Mon 2010-07-12 18:48:05 +0300
message:
  Use only values allowed by OpenGL ES 2.0 for the internalFormat in glTexImage2D().
  Don't try to use GL_LINEAR_MIPMAP_LINEAR for the MAG filter (it use only for the MIN filter).
modified:
  src/texture.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/texture.cpp'
--- src/texture.cpp	2010-07-12 15:34:44 +0000
+++ src/texture.cpp	2010-07-12 15:48:05 +0000
@@ -62,21 +62,21 @@ 
         glBindTexture(GL_TEXTURE_2D, pTexture[0]);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-        glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0,
+        glTexImage2D(GL_TEXTURE_2D, 0, texture_format, surface->w, surface->h, 0,
                      texture_format, GL_UNSIGNED_BYTE, surface->pixels);
 
         // Create Linear Filtered Texture
         glBindTexture(GL_TEXTURE_2D, pTexture[1]);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-        glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0,
+        glTexImage2D(GL_TEXTURE_2D, 0, texture_format, surface->w, surface->h, 0,
                      texture_format, GL_UNSIGNED_BYTE, surface->pixels);
 
         // Create trilinear filtered mipmapped texture
         glBindTexture(GL_TEXTURE_2D, pTexture[2]);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-        glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0,
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+        glTexImage2D(GL_TEXTURE_2D, 0, texture_format, surface->w, surface->h, 0,
                      texture_format, GL_UNSIGNED_BYTE, surface->pixels);
         glGenerateMipmap(GL_TEXTURE_2D);
     }