Set GL pixel row alignment to be 1, not the default 4
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 9 Apr 2011 19:50:46 +0000 (19:50 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 9 Apr 2011 19:50:46 +0000 (19:50 +0000)
Fixes a few problems with non-multiple of 4 wide textures or
framebuffer, namely, skewed/corrupted textures in one case and memory
corruption when taking screenshots in the other.

(cherry picked from r3570 by parasti)

git-svn-id: https://s.snth.net/svn/neverball/branches/gles@3572 78b8d119-cf0a-0410-b17c-f493084dd1d7

share/video.c

index 5418d34..2d51ab4 100644 (file)
@@ -103,6 +103,9 @@ int video_mode(int f, int w, int h)
                       GL_SEPARATE_SPECULAR_COLOR);
 #endif
 
+        glPixelStorei(GL_PACK_ALIGNMENT, 1);
+        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
         glDepthFunc(GL_LEQUAL);