Jump to content
  • Advertisement
Sign in to follow this  
Tryllion

OpenGL Why bitmap fonts doesnt move while resizing ?

This topic is 3885 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

Hi I am new to OpenGl, I tried to do a simple thing. Cube with text on the right. Problem is that when I risize window, cube is resizing too, but the text stay still in pozistion ?!? I change the resize code: glViewport (0, 0, (GLsizei)(width), (GLsizei)(height)); glMatrixMode (GL_PROJECTION); glLoadIdentity (); gluPerspective (45.0f, (GLfloat)(width)/(GLfloat)(height),0.1f, 100.0f); glMatrixMode (GL_MODELVIEW); glLoadIdentity (); and add a orto matrix: glViewport(0,0,width,height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f,640,480,0.0f,-1.0f,1.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); text is resizing and moving, but cube can be display in 2D :( How to resolve this problem ?>?

Share this post


Link to post
Share on other sites
Advertisement
From what resolution to what resolution (I see 640x480 in there)?
How are you rendering text?

EDIT: Bitmap fonts? Never really used them, but I believe it won't scale. Where's the text-rendering code?

Share this post


Link to post
Share on other sites
I took some code from NeHe tutorial.
640x480 is constatnt. I just resize window in witch opengl is drawing.
Bit map font code is here ->http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13

Which fonts are you using,recommend ?

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!