PDA

View Full Version : glRasterPos() & glPixelZoom()



devdept
07-15-2010, 12:43 AM
Hi All,

We are drawing the same 32x32 bitmap (rounded corner) at each viewport corner inverting it with glPixelZoom().

If the viewport is 100x100 pixel, is it allowes to do:


glRasterPos(100,100);
glZoomPixel(-1,-1);
gl.DrawPixel(...);
Looks like on some hardwares it works only with:


glRasterPos(99,99);
glZoomPixel(-1,-1);
gl.DrawPixel(...);
Otherwise it flickers...

Thanks,

Alberto

ZbuffeR
07-15-2010, 01:58 AM
if the viewport is 100x100, then each coordinate is valid when in [0;99] range, so indeed 100 is invalid.

Did you read this section "9. Careful Updating that Raster Position" here :
http://www.opengl.org/resources/features/KilgardTechniques/oglpitfall/

devdept
07-15-2010, 02:39 AM
I was suspecting it, thanks!

Alberto