PDA

View Full Version : glRasterPos problem - current position stays invalid



Marten
09-09-2013, 02:34 AM
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?

Marten
09-09-2013, 05:40 AM
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)