From 4259dfd10d616f62477133c953159912934554ca Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 19 Dec 2023 11:11:42 +0100 Subject: [PATCH] Revert "GL_UNPACK_ROW_LENGTH 's initial value is 0" This reverts commit df5a1d217d157e0b23dab4c464deb88ce85d2c92. --- Image-Loading-and-Displaying-Examples.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Image-Loading-and-Displaying-Examples.md b/Image-Loading-and-Displaying-Examples.md index fade066..352b9fb 100644 --- a/Image-Loading-and-Displaying-Examples.md +++ b/Image-Loading-and-Displaying-Examples.md @@ -137,6 +137,9 @@ bool LoadTextureFromFile(const char* filename, GLuint* out_texture, int* out_wid glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // Same // Upload pixels into texture +#if defined(GL_UNPACK_ROW_LENGTH) && !defined(__EMSCRIPTEN__) + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); +#endif glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image_width, image_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image_data); stbi_image_free(image_data);