Well, here’s the code I have been using…
void Window::Render()
{
if(isactive())
SetColor(.035, .25, .1250); // a tingier green than before...
else
SetColor(0.075, .125, .1250); // light blue, with a tinge of green.
glTranslated(0.0, 0.0, 0.001);
glRectf(xpos, ypos, xpos+width, ypos+height);
glTranslated(0.0, 0.0, -0.001);
for(int x(0); x < components.size(); x++)
components[x]->Render();
};
void FPSwindow::Render()
{
Window::Render();
float fps = 1000.0/clock->GetElapsed();
// glColor4d(0.85, 1.0, 0.85, 1.0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glColor3d(1.0, 1.0, 1.0);
font->glDrawText(xpos + 5, ypos - 5, "FPS: %f
", fps);
};
void WindowManager::Render()
{
glDisable(GL_LIGHTING);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0.0f, size, size * height/width, 0.0f, 1.0f, -1.0f);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
for(int x(0); x < components.size(); x++)
components[x]->Render();
glDisable(GL_BLEND);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glColor4d(1.0, 1.0, 1.0, 1.0);
glEnable(GL_LIGHTING);
};
That (now) shows the text somewhat brighter and the same color as the background. It isnt turning out as a bright green at all. I have tried many blending modes, and I have also tried pulling the text out of the blending functions altogether, but nothing seems to work correctly. Something else odd, I was having trouble getting text to display on the screen, but when I instantiated a second set of fonts, the first worked just fine. Whenever I remove the second font, the first stops showing up on the screen. Im blindly guessing these two problems are interrelated. Im gonna print out my code tomorrow, and go thru it with a fine toothed comb… maybe something’ll turn up.
[This message has been edited by 147-2 (edited 10-29-2002).]