Archived

This topic is now archived and is closed to further replies.

HardSniper

Changing text size during program...

Recommended Posts

Could anyone explain to me how I would change the text size of a font (like the one in NeHe''s 15th tutorial, "Texture Mapped Fonts")? I have tried calling the CreateFont() function later in the program, but it appears that OpenGL doesn''t recognize the call. HardSniper

Share this post


Link to post
Share on other sites
I have decided to ditch the idea of changing the size of the text, and just move it along the z-axis to make it appear smaller. I have a another question though... When I run the program like that, it won't draw anything but text to the screen... Anyone know why?

HardSniper

Edited by - HardSniper on November 16, 2001 4:21:29 PM

Share this post


Link to post
Share on other sites
Just a stupid question from an absolute newbie: I have the same problem that i can''t resize my fonts using the values in the CreateFont function call. Using glScale does the trick just fine, but i was just curious why changing the x and y value in CreateFont won''t do the trick. Using code based on the code in Nehe tutorial 15.

thnx!

Share this post


Link to post
Share on other sites
When you put text on the screen do this:
int DrawScene()
{
.....
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(...);
glPrint(....);
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
....
}

Share this post


Link to post
Share on other sites
You may also add this lines into glPrint function:

glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(...);
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();

Share this post


Link to post
Share on other sites