[SDL] Making a screenshot

benang at cs.its.ac.id benang at cs.its.ac.id
Tue Apr 10 23:45:49 PDT 2007


Ah, I see thanks guys. Although my first impression about screenshot would
be copying the surface to a clipboard daemon (eg. Klipper, or Windows'
Clipboard). But because I don't understand Linux that much, making a
bitmap file of the surface will be suffice right now. Maybe I'll explore
more on how to copy the surface's contents to KDE's Klipper when I have
time. Thanks alot guys.

Ryan C. Gordon said:
>
>> It is as simple as calling:
>>
>> SDL_SaveBMP( pSurface,"FILE.BMP" );
>>
>> The pSurface is a pointer to a SDL_Surface and the string is the
>> filename to
>> save it as.
>
> Yes. And for OpenGL, call glReadPixels() to get the contents of the
> OpenGL framebuffer...then you'd need to get the raw pixel data into some
> format you can use (like a SDL_Surface for SDL_SaveBMP, etc).
>
> --ryan.
>
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>


Fare thee well,
Bawenang R. P. P.

----------------
ERROR: Brain not found. Please insert a new brain!

“Do nothing which is of no use.” - Miyamoto Musashi.

"I live for my dream. And my dream is to live my life to the fullest."




More information about the SDL mailing list