Advertisement Jump to content

Archived

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

yot

Problem with Font in OpenGL

This topic is 6339 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 wanted to add some text into my app, but it does not work and do not really understand why... here is some code from the render function: void Scene() { glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluPerspective(90.0, (GLfloat) 640/(GLfloat) 480, 4.0, 4000.0); glMatrixMode( GL_MODELVIEW ); glPushMatrix(); ... //Render stuff here glPopMatrix(); glPopMatrix(); } void DrawText() { glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(0.0f,640,480,0.0f,-1.0f,1.0f); glMatrixMode( GL_MODELVIEW ); glPushMatrix(); glColor3f(1.0f,0.5f,0.5f); Font.glPrint(50,50,0,"Test"); glPopMatrix(); glPopMatrix(); } When I disable the scene function the Text works and if I disable the DrawText function the scene works but if I enable both nothing is working at all. I''ll get a white screen with empty black box of the size of the text Please help yot

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!