Opengl in png

I am trying to convert an open OpenGL map [edit: "which I drew" (?) :) thanks unwind] containing a lot of textures (without moving anything) into one PNG file that I can use in another part of the frame I'm working with . Is there a C ++ library that does this?

thanks!

+4
source share
3 answers

If you just mean "take a scene rendered by OpenGL and save it as an image," then it's pretty simple. You need to read the scene using glReadPixels (), and then convert this data to an image format such as PNG ( http://www.opengl.org/resources/faq/technical/miscellaneous.htm ).

There are also more effective ways to achieve this, such as using FBO s. Instead of rendering the scene directly in the framebuffer, you can render it with a texture via FBO and then render that texture as a full-screen quad. You can take this texture and save it to a file (e.g. glGetTexImage ).

+10
source

What is an "OpenGL file"? OpenGL is a graphical API; it does not specify any file formats. Do you mean a DDS file or something else?

+1
source

There are better ways to lay out textures than draw them using a graphics card. This is really what you would like to do before hand on the processor, store, and then use how and when you need it with opengl

+1
source

All Articles