[SDL] Segmentation fault from SDL_DisplayFormat?

Johannes Prix johannesprix at users.sourceforge.net
Sun Jul 27 10:11:11 PDT 2003


Gabriele Greco wrote:

> Johannes Prix wrote:
>
>>      StoredMenuBackground = SDL_DisplayFormat ( Screen );
>
>
> What are you doing has not much sense, SDL_DisplayFormat should be 
> used to convert a bitmap to the screen format, here you are trying to 
> convert the screen surface to the same format it has, I think that 
> what you want to do is to clone the screen surface, to do so use 
> SDL_CreateRGBSurface() and then SDL_BlitSurface from screen to the new 
> surface.


Whether it makes much sense or not, whether it is efficient code or not, 
it shouldn't segfault, right?  Anyway, thanks for the workaround, but 
I'd like to know why the segfault.  Thanks again anyone for bothering to 
think about the issue.

Have fun, jp.






More information about the SDL mailing list