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: glRasterPos problem - current position stays invalid

  1. #1
    Newbie Newbie
    Join Date
    Sep 2013
    Posts
    2

    glRasterPos problem - current position stays invalid

    I am getting a rather odd error while displaying bitmap texts on screen and using glRasterPos3f function to position them. When I start the application, all my texts fit inside the view and everything works just the way it should. However, things start to go wrong as soon as one of them gets outside the view - all my texts disappear and won't reappear ever again not even if I set the view back to its original, formerly non-problematic position.

    I did some investigation and made an explicit check of the raster position validity flag, like this:

    glRasterPos3f(xPos, yPos, zPos);

    // check raster position validity
    GLboolean valid;
    pin_ptr<GLboolean> p_valid = &valid;
    glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, p_valid);
    if (!valid)
    return;

    Well and what I found out is that the condition at the end of this code gets triggered not just when a text position gets outside the view, but from then on ever since. The current raster position remains invalid even if I restore the view to its usual working state from which none of the input text positions in 3D should get clipped. The validity bit simply appears to stay cleared forever. Any ideas on what might be the possible cause for this or maybe how to restore raster position manually somehow?

    PS: I am using GLSL shaders to work with matrices, could that be a problem even if everything else get rendered correctly this way?

  2. #2
    Newbie Newbie
    Join Date
    Sep 2013
    Posts
    2
    Some pics:

    Working state, all is well:
    i.imgur.com/SFGU4QI.png

    I zoom in, some current raster position gets invalid, all texts disappear:
    i.imgur.com/cj2xVAs.png

    I zoom out again, still no texts, so I have to restart the app:
    i.imgur.com/kx3iPNR.png

    (I can't post urls yet)

Posting Permissions

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