Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glRasterPos2f moves Backbuffer?!?

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2015
    Posts
    6

    Question glRasterPos2f moves Backbuffer?!?

    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:

    Code :
    VAR OldPosition:ARRAY[0..3]OF Single;
    BEGIN
      glGetFloatv(GL_CURRENT_RASTER_POSITION,@OldPosition); //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

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2015
    Posts
    6
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •