diff --git a/test_app.c b/test_app.c index ddb2e11..9bb5f25 100644 --- a/test_app.c +++ b/test_app.c @@ -66,8 +66,11 @@ WASM_EXPORT(App_ResourceLoaded) void App_ResourceLoaded(int resourceIndex, int f { PrintLine_D("Parsed image: %p %dx%d %d channel(s)", textureBytes, imageWidth, imageHeight, imageChannelCount); + #if 0 + //NOTE: Firefox claims that this is deprecated? + jsGlPixelStorei(GL_UNPACK_FLIP_Y_WEBGL, true); + #else //We need to reverse the rows of pixels so the image is not upside-down - //TODO: Replace with GL_UNPACK_FLIP_Y_WEBGL u32 rowWidth = imageWidth * sizeof(u32); u8* tempRowBuffer = AllocArray(u8, scratch, rowWidth); for (int yIndex = 0; yIndex < imageHeight/2; yIndex++) @@ -76,6 +79,8 @@ WASM_EXPORT(App_ResourceLoaded) void App_ResourceLoaded(int resourceIndex, int f memcpy(&textureBytes[yIndex * rowWidth], &textureBytes[(imageHeight-1 - yIndex) * rowWidth], rowWidth); memcpy(&textureBytes[(imageHeight-1 - yIndex) * rowWidth], tempRowBuffer, rowWidth); } + #endif + #if 0 for (int yIndex = 0; yIndex < imageHeight; yIndex++) { @@ -95,7 +100,6 @@ WASM_EXPORT(App_ResourceLoaded) void App_ResourceLoaded(int resourceIndex, int f jsGlActiveTexture(GL_TEXTURE0); jsGlBindTexture(GL_TEXTURE_2D, app.testTexture); // jsGlPixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1); - // jsGlPixelStorei(GL_UNPACK_FLIP_Y_WEBGL, true); jsGlTexImage2D( GL_TEXTURE_2D, //bound texture type 0, //image level