Jump to content
  • Advertisement
Sign in to follow this  
szecs

How to handle fonts, that begin offscreen

This topic is 3213 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using wglUseFontBitmaps to display strings, and the problem is that with negative x,y coordinates in glRasterPos3i bitmaps aren't displayed (I know why/or maybe not). How could I overcome this? Is texture font the only solution for that? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
In my framework (C#), I convert on the fly TTF fonts to texture font. Look at the SVN for more informations.

Share this post


Link to post
Share on other sites
The raster position, when set by glRasterPos, is subject to the same transformations and clipping as any other vertex. If the raster position is clipped, it is also marked as invalid and any operation using the raster position is ignored. That's why you can't directly place the raster position outside the viewport using glRasterPos.

Since you want to set it in window coordinates (edit: rather, I assume that's what you want), I suggest you use glWindowPos instead. The whole idea of it is to specify the raster position in window coordinates, without having to setup the matrices properly, and, most importantly for you, it will not mark the raster position as invalid at any time.

Share this post


Link to post
Share on other sites
Quote:
Original post by Brother Bob
The raster position, when set by glRasterPos, is subject to the same transformations and clipping as any other vertex. If the raster position is clipped, it is also marked as invalid and any operation using the raster position is ignored. That's why you can't directly place the raster position outside the viewport using glRasterPos.

Since you want to set it in window coordinates (edit: rather, I assume that's what you want), I suggest you use glWindowPos instead. The whole idea of it is to specify the raster position in window coordinates, without having to setup the matrices properly, and, most importantly for you, it will not mark the raster position as invalid at any time.
I'm still in the gl 1.1 era...
But works nicely, thank you!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!