Skip to content

Commit 6742d9f

Browse files
committed
Fix pixel row alignment bug in gsub_lite.
1 parent 4842202 commit 6742d9f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

examples/opticalStereo/opticalStereo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ static void DisplayPerContext(const int contextIndex)
10941094
glMatrixMode(GL_MODELVIEW);
10951095
glLoadIdentity();
10961096
glRasterPos2f(0.0f, 0.0f);
1097-
glPixelTransferi(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
1097+
glPixelStorei(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
10981098
glPixelZoom(1.0f, 1.0f);
10991099
glDrawPixels(viewContexts[contextIndex].width, viewContexts[contextIndex].height, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, stereoStencilPattern);
11001100
//glDrawPixels(windowWidth, windowHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, stereoStencilPattern);

examples/stereo/stereo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ static void DisplayPerContext(const int contextIndex)
11381138
glMatrixMode(GL_MODELVIEW);
11391139
glLoadIdentity();
11401140
glRasterPos2f(0.0f, 0.0f);
1141-
glPixelTransferi(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
1141+
glPixelStorei(GL_UNPACK_ALIGNMENT, ((viewContexts[contextIndex].width & 0x3) == 0 ? 4 : 1));
11421142
glPixelZoom(1.0f, 1.0f);
11431143
glDrawPixels(viewContexts[contextIndex].width, viewContexts[contextIndex].height, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, stereoStencilPattern);
11441144
} else

lib/SRC/Gl/gsub_lite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ int arglPixelBufferDataUpload(ARGL_CONTEXT_SETTINGS_REF contextSettings, ARUint8
796796
glActiveTexture(GL_TEXTURE0);
797797
glBindTexture(GL_TEXTURE_2D, contextSettings->texture);
798798

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

801801
if (contextSettings->arhandle) {
802802
arGetDebugMode(contextSettings->arhandle, &arDebugMode);

0 commit comments

Comments
 (0)