ilutGLSubTex and glPixelStorei

2006-12-28
2013-05-02
  • When updating a texture with ilutGLSubTex, the OpenGL UNPACK states might have changed (compared to what they were when creating the texture with ilutGLBindTexImage)

    I suggest adding the following code to ilutGLSubTex, just before glTexSubImage2D
    (these are copied settings from ilutGLBindTexImage)

        ::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
        ::glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
        ::glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
        ::glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
        ::glPixelStorei(GL_UNPACK_SWAP_BYTES, IL_FALSE);

     
    • remove the :: in front of the OpenGL calls (namespace issue)