You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: unspecified Reported for operating system, platform: Windows 7, x86_64
Comments on the original bug report:
On 2013-09-23 09:34:52 +0000, Mike Parker wrote:
Created attachment 1336
Tri-colored image that demonstrates the color inversion.
When loading 32-bit RGBA images, the pixel format is set to SDL_PIXELFORMAT_ABGR8888. Converting the image to SDL_PIXELFORMAT_RGBA8888 and then passing it to OpenGL with both the internal storage and texture format set to GL_RGBA results in the texture being displayed with the colors inverted. However, if the ABGR8888 image is passed as is with no conversion, again with both internal storage and texture format set to GL_RGBA, then the colors display correctly.
In short, SDL_PIXELFORMAT_RGBA8888 is backwards compared to GL_RGBA, but SDL_PIXELFORMAT_ABGR8888 is not.
Compiling as 32-bit on 64-bit Windows 7.
On 2013-09-23 09:35:15 +0000, Mike Parker wrote:
Created attachment 1337
Another image that demonstrates the color inversion.
On 2013-10-18 07:55:13 +0000, Sam Lantinga wrote:
SDL's pixel formats are packed pixels which are endian dependent, while OpenGL's pixel formats are (usually) byte arrays, which are not endian dependent.
The SDL 2D renderer uses SDL_PIXELFORMAT_ARGB8888 with this code:
case SDL_PIXELFORMAT_ARGB8888:
*internalFormat = GL_RGBA8;
*format = GL_BGRA;
*type = GL_UNSIGNED_INT_8_8_8_8_REV;
break;
You just need to account for the OpenGL formats you plan to use when you're loading your data.
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: unspecified
Reported for operating system, platform: Windows 7, x86_64
Comments on the original bug report:
On 2013-09-23 09:34:52 +0000, Mike Parker wrote:
On 2013-09-23 09:35:15 +0000, Mike Parker wrote:
On 2013-10-18 07:55:13 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: