We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 664 - SDL_SetVideoMode() RGB/BGR swap under X
Summary: SDL_SetVideoMode() RGB/BGR swap under X
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-03 12:09 UTC by Donny Viszneki
Modified: 2011-01-19 22:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Donny Viszneki 2009-01-03 12:09:40 UTC
Standard RGB/BGR switch problem. I stepped through the video initialization process on my system and noticed that if I ask for 24-bit color with SDL -- or if SDL decides for 24-bit color when I pass zero for the bpp argument of SDL_SetVideoMode() -- then red and blue color components get swapped. If I pass 32 as the bpp argument, all is well. I will attach a source code to demonstrate the issue.
Comment 1 Donny Viszneki 2009-01-03 12:18:48 UTC
I tried attaching a file, but Bugzilla gave me this message:

undef error - Undefined subroutine Fh::slice at data/template/template/en/default/global/hidden-fields.html.tmpl line 58

You can find the file test-color.c as an attachment here:

http://article.gmane.org/gmane.comp.lib.sdl/39575
Comment 2 Sam Lantinga 2009-12-15 16:46:58 UTC
I think I fixed this in the latest snapshot.  Can you take a look?
http://www.libsdl.org/tmp/SDL-1.3.zip
Comment 3 Sam Lantinga 2011-01-19 22:49:08 UTC
This bug has been waiting for over a year, I'm closing it for now.  Please reopen this bug if it's still an issue for you! :)