Sign in to follow this  
disruptive

Open GL images

Recommended Posts

I am working in Linux with Open GL. I wish to save an image to file - i.e. a screen shot. Of course I dont want to print screen everytime I wish to save a frame. I am at a toaly loss for how to do this consistently, as I find so many conflicting and not working information on the net. If you can help that would be very much appreciated. I am using Fedora Core 3, Open GL and I have gdlib installed to handle the images. Best Brett

Share this post


Link to post
Share on other sites
Well, I guess that this problem can be divided into two parts. The step one is related to OpenGL. You have to collect the pixels from the framebuffer. To do that you can use glReadPixels(...). Once you have a block of data containing pixels, you reach the step number two which actually doesn't have much to do with OpenGL. It's aim is to create an image's file. I believe that the image library you use is capable of saving images basing on stored pixel data. If not, you can do it 'by yourself' assuming that you get familiar with a particular file format description.

Share this post


Link to post
Share on other sites
I am using gdlib for Linux. However I cant seem to get a decent crossover between reading the frame from open gl and actually getting the data over to the dglib to readit and write it. I cannot find documentation to support the latter as I dont know what format to pass in data from readpixels.

Really damn confusing. Any help much appreciated.


Brett

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this