PDA

View Full Version : glRasterPos2f moves Backbuffer?!?



Bernd82
04-04-2015, 08:23 AM
Hi,

I have a 2D image. I want to output text to a certain position with glRasterPos2f and glBitmap. Fortunately the text is painted on the right position in the backbuffer. Unfortunately the whole content of the backbuffer is moved when I use swapbuffers. The cause seems to be glRasterPos2f. I tried this but it doesn't work:


VAR OldPosition:ARRAY[0..3]OF Single;
BEGIN
glGetFloatv(GL_CURRENT_RASTER_POSITION,@OldPositio n); //remember old RasterPos?!?
glRasterPos2f(CharX,CharY); //Move to char position
glBitmap(8,8,0,0,Feed,0,@CharBitmap); //Print the char
glRasterPos3fv(@OldPosition); //Try to undo the movement
END;

Thanks for any hint and best regards, Bernd

Bernd82
04-04-2015, 12:07 PM
Ah, I saw that those coordinates differ. So glGetFloatV(GL_CURRENT_RASTER_POSITION,@OldPositio n) returns window coordinates. Whereas glRasterPos will translate the given coords. Very confusing.