From: Steinar H. Gunderson Date: Sat, 13 Oct 2012 21:51:12 +0000 (+0200) Subject: Move the GL_UNPACK_ALIGNMENT setting into the texture creation, so that clients won... X-Git-Tag: 1.0~256 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=af39090a8902411ffc0c89f296a0f8bde9229f60;hp=02dd3a9d0eac3d760dd09cf3690d0c1b92155cf1 Move the GL_UNPACK_ALIGNMENT setting into the texture creation, so that clients won't have to worry. --- diff --git a/demo.cpp b/demo.cpp index 625dba6..0cc3c48 100644 --- a/demo.cpp +++ b/demo.cpp @@ -154,7 +154,6 @@ int main(int argc, char **argv) SDL_WM_SetCaption("OpenGL window", NULL); // geez - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); unsigned img_w, img_h; diff --git a/flat_input.cpp b/flat_input.cpp index 31800a7..b37a1ec 100644 --- a/flat_input.cpp +++ b/flat_input.cpp @@ -85,6 +85,8 @@ void FlatInput::finalize() 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); diff --git a/ycbcr_input.cpp b/ycbcr_input.cpp index 268abcb..8d58c7d 100644 --- a/ycbcr_input.cpp +++ b/ycbcr_input.cpp @@ -49,6 +49,9 @@ YCbCrInput::~YCbCrInput() 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();