Re: Getting an image from gtkglarea



On Mon, 7 Oct 2002 11:06:23 +0200
"Peder Pedersen" <master yoda cyberdude dk> wrote:

How do I get access to an array containing the image i have rendered in a gtkglarea widget?

It purely an opengl mechanism, not gtk dependent, that reads pixels in the frame buffer :

*******code begins here
Data = malloc (sizeof (unsigned char) * width * height * 4);
glReadPixels (0, 
        0, 
        width, height, 
        GL_RGBA, 
        GL_UNSIGNED_BYTE, 
        Data);
********* code stops here

As all other GL raster operation, it is modified by transformation applied on it 
(glortho, blend, dither...) 

-Paul



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]