Sign in to follow this  
nerdinator

why FTGL slows down when I use colors?

Recommended Posts

I use FTGL to render fonts in my OpenGL/SDL game. Here is my printing function:
[CODE]void show_text(FTGLPixmapFont& font,int score)
{
char temp[32];

sprintf(temp, "%d", score); // conver score to a char*

font.FaceSize(23);

glColor4f(1.0,1.0,1.0,1.0);
glRasterPos3f(150,150,0);
font.Render("score:");
glRasterPos3f(150,180,0);
font.Render(temp);
glLoadIdentity();

}[/CODE]

I call this everytime I refresh the screen , just like the rest of the parts of my game are repainted. It works fine. But when I change [CODE]glColor4f(1.0,1.0,1.0,1.0);[/CODE] to [CODE]glColor4f(1.0,1.0,0.5,1.0);[/CODE] the game gets much much slower. Why is this happening?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this