]> git.sesse.net Git - movit/commitdiff
Move the GL_UNPACK_ALIGNMENT setting into the texture creation, so that clients won...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Oct 2012 21:51:12 +0000 (23:51 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Oct 2012 21:51:12 +0000 (23:51 +0200)
demo.cpp
flat_input.cpp
ycbcr_input.cpp

index 625dba6097d724c5a7fa6a3e66b72a32b46d1a0d..0cc3c48a4fedac0375ca12736be807d14cc3e752 100644 (file)
--- a/demo.cpp
+++ b/demo.cpp
@@ -154,7 +154,6 @@ int main(int argc, char **argv)
        SDL_WM_SetCaption("OpenGL window", NULL);
        
        // geez 
        SDL_WM_SetCaption("OpenGL window", NULL);
        
        // geez 
-       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
        glPixelStorei(GL_PACK_ALIGNMENT, 1);
 
        unsigned img_w, img_h;
        glPixelStorei(GL_PACK_ALIGNMENT, 1);
 
        unsigned img_w, img_h;
index 31800a74a28c69dc7368d47e48c7ce77cfa1431a..b37a1ec97d0392568c8f8ca49dfdb3dbde30b82b 100644 (file)
@@ -85,6 +85,8 @@ void FlatInput::finalize()
        check_error();
        glBindTexture(GL_TEXTURE_2D, texture_num);
        check_error();
        check_error();
        glBindTexture(GL_TEXTURE_2D, texture_num);
        check_error();
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       check_error();
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, needs_mipmaps ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR);
        check_error();
        glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, needs_mipmaps ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR);
        check_error();
        glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch);
index 268abcb35059cc722ea7fc1f3495a9aebda0ad02..8d58c7de8ab10c6d09adf68fa0bc8ef467f8be51 100644 (file)
@@ -49,6 +49,9 @@ YCbCrInput::~YCbCrInput()
 
 void YCbCrInput::finalize()
 {
 
 void YCbCrInput::finalize()
 {
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       check_error();
+
        // Create PBOs to hold the textures holding the input image, and then the texture itself.
        glGenBuffers(3, pbos);
        check_error();
        // Create PBOs to hold the textures holding the input image, and then the texture itself.
        glGenBuffers(3, pbos);
        check_error();