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 398

Summary: SDL_SetPalette() reserved for screen surfaces?
Product: SDL Reporter: Patrice Mandin <patmandin>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2    
Version: 1.2.11   
Hardware: All   
OS: All   

Description Patrice Mandin 2007-02-22 16:44:22 UTC
Hello,

When trying to add some custom file formats to SDL_Image, I came into a problem with palettized surfaces. I used SDL_SetPalette() to set the palette of the SDL_Surface to be returned to the application. However it is not working, because 'showimage' program loads the image first, then setup a video mode to display it.

This is because SDL_SetPalette() checks if a video driver is available before doing its work, and will fails with any SDL_Surface till a video driver is initialized and available.

I think it should be pretty easy to make it work without a video driver being available. The screen-only stuff is the management of SDL_PHYSPAL flag when calling the function
Comment 1 Sam Lantinga 2007-07-03 02:39:37 UTC
This is fixed in revision 3125.  Thanks!