Trasform a openGL texture to SDLsurface

Hi,
I already found the way for converting an SDLsurface to OpenGL texture but now I need the opposite thing.
I have a small SDL-OpenGL project that draw the buffer on a texture and I want save this texture on disk.
My idea was to convert this texture to SDLsurface and then save it with SDLSaveBmp.

Thanks for any hint.

Regards
Dahman

Hiyya, how does your project write to a surface now? The stable sdl version has every function you could need to convert whatever wherever. Where to start? I would look at sdl format and color. If you have a specific issue the stable sdl has lots of documentation on how and why in each step. Please do ask questions if it’s not clear.

---- Abderrahmane Madani <abderrahmane.madani at bncelettronica.com> wrote:=============
Hi,
I already found the way for converting an SDLsurface to OpenGL texture but now I need the opposite thing.
I have a small SDL-OpenGL project that draw the buffer on a texture and I want save this texture on disk.
My idea was to convert this texture to SDLsurface and then save it with SDLSaveBmp.

Thanks for any hint.

Regards
Dahman

glReadPixels() and similar OpenGL APIs provide a means of
"downloading" the framebuffer into client memory.

http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.htmlOn Fri, Mar 6, 2009 at 4:01 AM, Abderrahmane Madani <abderrahmane.madani at bncelettronica.com> wrote:

I have a small SDL-OpenGL project that draw the buffer on a texture and I
want save this texture on disk.
My idea was to convert this texture to SDLsurface and then save it with
SDLSaveBmp.


http://codebad.com/

Hiyya. Make two surfaces with sdl and make one the destination. After that, write one to the other converting to sdl surface. Screen print that surface woot. There should be sdl functions to do these things. It sounds like you have the ability to look up the functions and you know how to write to a surface with gl. I guess just give it the old collage midnight cram session try one evening and tell me/us/them what part stumps you, even if it’s the first function. Maybe someone else has more to say but if you show me the code I can correct it but otherwise I can only point the way.

---- Donny Viszneki <donny.viszneki at gmail.com> wrote:=============
On Fri, Mar 6, 2009 at 4:01 AM, Abderrahmane Madani <abderrahmane.madani at bncelettronica.com> wrote:

I have a small SDL-OpenGL project that draw the buffer on a texture and I
want save this texture on disk.
My idea was to convert this texture to SDLsurface and then save it with
SDLSaveBmp.

glReadPixels() and similar OpenGL APIs provide a means of
"downloading" the framebuffer into client memory.

http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.html


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi,

this could be a solution:

http://article.gmane.org/gmane.comp.lib.sdl/39418

Best Regards_______________________________________________________________________
Jetzt 1 Monat kostenlos! WEB.DE FreeDSL - Telefonanschluss + DSL
f?r nur 17,95 EURO/mtl.!* http://dsl.web.de/?ac=OM.AD.AD008K15039B7069a

Excellent !
thank you Amin

Regards
dahman

----- Messaggio originale -----Da: “Armin Steinhoff”
A: “A list for developers using the SDL library. (includes SDL-announce)”
Inviato: Domenica, 8 marzo 2009 10:50:24 GMT +01:00 Amsterdam/Berlino/Berna/Roma/Stoccolma/Vienna
Oggetto: Re: [SDL] trasform a openGL texture to SDLsurface

Hi,

this could be a solution:

http://article.gmane.org/gmane.comp.lib.sdl/39418

Best Regards


Jetzt 1 Monat kostenlos! WEB.DE FreeDSL - Telefonanschluss + DSL
f?r nur 17,95 EURO/mtl.!* http://dsl.web.de/?ac=OM.AD.AD008K15039B7069a


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org