Skip to content

Commit

Permalink
Fix pixel row alignment bug in gsub_lite.
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-lamb committed Mar 9, 2018
1 parent 4842202 commit 6742d9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/opticalStereo/opticalStereo.c
Expand Up @@ -1094,7 +1094,7 @@ static void DisplayPerContext(const int contextIndex)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRasterPos2f(0.0f, 0.0f);
glPixelTransferi(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
glPixelStorei(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
glPixelZoom(1.0f, 1.0f);
glDrawPixels(viewContexts[contextIndex].width, viewContexts[contextIndex].height, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, stereoStencilPattern);
//glDrawPixels(windowWidth, windowHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, stereoStencilPattern);
Expand Down
2 changes: 1 addition & 1 deletion examples/stereo/stereo.c
Expand Up @@ -1138,7 +1138,7 @@ static void DisplayPerContext(const int contextIndex)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRasterPos2f(0.0f, 0.0f);
glPixelTransferi(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
glPixelStorei(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
glPixelZoom(1.0f, 1.0f);
glDrawPixels(viewContexts[contextIndex].width, viewContexts[contextIndex].height, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, stereoStencilPattern);
} else
Expand Down
2 changes: 1 addition & 1 deletion lib/SRC/Gl/gsub_lite.c
Expand Up @@ -796,7 +796,7 @@ int arglPixelBufferDataUpload(ARGL_CONTEXT_SETTINGS_REF contextSettings, ARUint8
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, contextSettings->texture);

glPixelTransferi(GL_UNPACK_ALIGNMENT, (((contextSettings->bufSizeX * contextSettings->pixSize) & 0x3) == 0 ? 4 : 1));
glPixelStorei(GL_UNPACK_ALIGNMENT, ((((contextSettings->bufSizeIsTextureSize ? contextSettings->textureSizeX : contextSettings->bufSizeX) * contextSettings->pixSize) & 0x3) == 0 ? 4 : 1));

if (contextSettings->arhandle) {
arGetDebugMode(contextSettings->arhandle, &arDebugMode);
Expand Down

0 comments on commit 6742d9f

Please sign in to comment.