Re: glReadPixels and viewport problem
Mårten Strömberg <[email protected]> Thu, 27 Nov 2003 00:58:10 +0100
| Newsgroups | gmane.linux.opengl |
|---|---|
| Message-ID | <[email protected]> |
Paulo, Try the following before calling glReadPixels: glPixelStorei(GL_PACK_ALIGNMENT, 1); I believe it defaults to 4, which is not a divisor of 250. BTW, I did not remember being subscribed to linux-opengl! Is the list still active? Regards, Marten On Thursday 27 November 2003 00.35, Paulo Jorge de Oliveira Cantante de Matos wrote: > Hi all, > > I'm developing an application in which I get the viewport through > glReadPixels and then I write it in to a PPM file. A situation depending > on the viewport size arises. If the viewport is 250x250, the buffer > returned from glReadPixels shows the viewport in 'italic' (the image is > incorrect), a vertical line comes as a diagonal for example. However, if > size is 500x500, everything is fine. Other similar situations arise > depending on the viewport size. This is indeed strange, I've not set any > state variable relating to glReadPixels, do I need to set or enable any > special variable? Is this a known issue? > > I've decided not to include any code, if you would like some code to > test it, I'll be happy to send it to you privately. > > Oh, and the problem is not in the procedure that writes the PPM file > from the glReadPixels buffer since it was tested by some people and all > get the same results with glReadPixels (I cannot assure you it's not in > the PPM file but it's not probable). > > Best regards, - To unsubscribe from this list: send the line "unsubscribe linux-opengl" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html