PDA

View Full Version : Raster Position



Itch
02-22-2001, 11:43 AM
Hi,
this is really an ongoing thing from a Post a few days ago:

What I want to do is display text in location x,y on the screen. I've finally managed to get some text on the screen, but if I don't set the position then is moves across the bottom of the screen this disappears. If I do set the position, then nothing appears at all.
Here's the code:

char output[MAX_LINE];
float raster[4];

...

glGetFloatv(GL_CURRENT_RASTER_POSITION,raster);

glRasterPos4i(raster[0],raster[1],raster[2],raster[3]);

sprintf(output,"%f",raster[0]);

printString(output);


So without the glRasterPosXi the code works, leaving me with no control over the text's position. With the line, nothing appears at all.
thanks again folks

james

j
02-22-2001, 12:48 PM
Check to see if the raster position will actually be on the screen. If the raster position is not on the screen, then ALL of the text drawn at that position will NOT be drawn.

j

Itch
02-22-2001, 02:17 PM
I will do this, however:
if I remove the glRasterPos4i line, then it text appears at the bottom of the screen, therefore I'm partly confused as to why when I am setting the raster to itself why does my text disappear?

thanks

james

DFrey
02-22-2001, 03:07 PM
You aren't setting it to itself.
You are getting floating point values but setting integer values. And that raster position that you send gets transformed by the current modelview matrix as well.