Hi, anybody knows why glDrawPixels(0,y) flickers?
coords for glRasterPos are from gluUnProject
Hi !
Depends on what you mean with “flickering”, the most common problem is that you are not using double buffering, glDrawPixels is a pretty slow operation and can cause flickering if you are not using doublebuffering.
Mikael
To be more precise:
- i use double bufferin’,
- i use gluUnProject to get coords for glRasterPos,
- every time i want to render on the left edge (x=0, y=no matter what) and then i rotate camera (gluLookAt) the bitmap drawed by glDrawPixels flicks - it’s sometimes visible, sometimes not
- i got rid of the problem of performance with glDrawPixels - now it’s amazingly fast! - i can draw many time ~1024 bitmaps without performance degradation
- every time i want to render on the left edge (x=0, y=no matter what) and then i rotate camera (gluLookAt) the bitmap drawed by glDrawPixels flicks - it’s sometimes visible, sometimes not
That happens if the rasterpos gets invalid, which is when it’s not in the 3D viewing frustum after transformations.
A simple fix would be to enable this
http://oss.sgi.com/projects/ogl-sample/registry/IBM/rasterpos_clip.txt
if it’s supported by your implementation.
Otherwise you need to make sure your transformed rasterpos does not fall oout of the frustum, or if it does, clamp it to the screen and skip pixels of the source bitmap.