Draw a text in a window

I have a problem on drawing a text in a window.
When I draw a text that can be completely located in a window, I have no problem at all. However, when I draw a text starting out of a window and ending in a winow, I have a problem. I can’t see anything in a window. I think a part of the text must be drawn in a window.

Anybody has a clue to fix this problem?

J.

Are you using bitmap fonts. If so the starting position is determined by glRasterPos(). If the rasterposition is off screen it becomes invalid and nothing depending on raster position gets drawn until the rasterposition is set to a valid position again.

Thanks for your reply.

If so, what can I do to draw a text starting off screen and ending on screen?

Change bitmap font to others?
Manual calc to get a starting character on screen?
???

J

One solution would be to draw the text using a texture map(see nehe.gamedev.net for example). You apply the text texture to a quad and just translate it into the screen to provide the scrolling effect also this way you can use any font.

The other way is with the bitmap and using a text string. Just move the starting point in which you print the text from the string.

char *My_text=“Welcome to the machine!”;

W = 0…!=23

x // is the point on the string you wish to print, to give a scrolling effect.
print first pass x=23 “!”
next pass, print x=22,23 “e!”
repest until you have scrolled the text on to the screen, repeat same as it goes off the screen, except start decreasing numbers.

print_to_screen(My_text);

Originally posted by JHome4U:
[b]Thanks for your reply.

off screen and ending on screen?

Change bitmap font to others?
Manual calc to get a starting character on screen?
???

J[/b]

[This message has been edited by nexusone (edited 04-26-2002).]

[This message has been edited by nexusone (edited 04-26-2002).]