Jump to content
  • Advertisement
Sign in to follow this  
BangorRipper

***icons and text on screen***

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

is the following the best way to display text i.e high score and number of lives etc on my screen? i have a 3d game viewed from a fixed perspective so really its 2d but with 3d models and i need to display high score: glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho( 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f ); glMatrixMode( GL_MODELVIEW ); glBindTexture( GL_TEXTURE_2D, radarIDTexture ); glEnable( GL_TEXTURE_2D ); //enable your bitmaps texture glDisable( GL_LIGHTING ); // disable lighting glDisable( GL_DEPTH_TEST ); // disable depth testing // White is a great color for material to texture glColor3f( 1.0, 1.0, 1.0 ); // draw a quad to texture with glBegin( GL_QUADS ); glTexCoord2f( 0.0, 0.0 ); glVertex2f( 0.0, 0.0 ); glTexCoord2f( 1.0, 0.0 ); glVertex2f( 0.3, 0.0 ); glTexCoord2f( 1.0, 1.0 ); glVertex2f( 0.3, 0.2 ); glTexCoord2f( 0.0, 1.0 ); glVertex2f( 0.0, 0.2 ); glEnd( ); Then.....destroy the ortho projection similar to lazork357' s approach and disable glBlend Also, in your init() function set up for blending : glEnable(GL_BLEND); // give blending translucensy to your bitmaps by calling this function glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); is this the best way to do it and does this just get done within a method? where should i call the method from? also is there anywhere i could find for instance a texture for the radar? are there code examples of games where something similar has been done? thanks, sorry for all the questions but i am a newbie

Share this post


Link to post
Share on other sites
Advertisement
Hi,

I would push the projection matrix before you go to ortho. That way all you have to do to switch back to projection is pop the matrix. Check out the font system I implemented on this thread:

http://www.gamedev.net/community/forums/topic.asp?topic_id=290348

You're going to have to do a bit of digging to find the source tree ect (proly on page 7). There are also a few other subsystems that you might be interested in like:

- texture loading
- 3d sound
- model loading

Cheers,
- llvllatrix

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!