|
Output Text in AllegroGL |
James Stanley
Member #7,275
May 2006
|
You may remember my other thread about AllegroGL. Well, that went a little off topic, so for my newest problem I'm having another thread. I've got my button drawn properly in the window now, and when I click it, I've got my ship flying around the screen and it's all fine and dandy and running at 800fps (as opposed to 24 with just Allegro). But then I tried to put some writing on the screen and I got stuck. Here's a stripped down version of the offending code:
EDIT: void opengl_init(void) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-320, 320, -240, 240, -1, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); }
|
LordHolNapul
Member #3,619
June 2003
|
try this: /* First, draw the text alpha blended */ glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); allegro_gl_printf(demofont, 1, 8, 0, makeacol(255,255,255,255), "Hello World!"); glBlendFunc(GL_ONE, GL_ZERO); glDisable(GL_BLEND);
remember to erase the color afther this, because otherwise you damage the further outputs. |
James Stanley
Member #7,275
May 2006
|
Yes! EDIT: |
|