diff --git a/Engine.cc b/Engine.cc index 23772c5..25ad59f 100644 --- a/Engine.cc +++ b/Engine.cc @@ -507,12 +507,14 @@ void Engine::drawText(const char * text, GLfloat r, GLfloat g, GLfloat b, int ptsize, float x, float y) { m_font->FaceSize(ptsize); - glPushMatrix(); - glTranslatef(x, y, 0); - GLfloat color[] = {r, g, b, 1.0}; - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color); - m_font->Render(text); - glPopMatrix(); + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_LIGHTING); + glPushMatrix(); + glTranslatef(x, y, 0); + glColor3f(r, g, b); + m_font->Render(text); + glPopMatrix(); + glPopAttrib(); } void Engine::getTextSize(const char * text, int ptsize, diff --git a/tests/bowling.lua b/tests/bowling.lua index d782bde..ecb880b 100644 --- a/tests/bowling.lua +++ b/tests/bowling.lua @@ -57,10 +57,10 @@ end function update_overlay_event(width, height) local tw, th = ag.getTextSize("Hi there", 18) ag.drawText("Hi there", 1, 1, 1, 18, width - tw - 4, height - th - 4) - ag.drawLine(1, 0, 0.3, 10, 10, 40, 60) - ag.drawLine(1, 0.7, 1, 50, 10, 100, 60, 5) - ag.drawRect(0, 1, 0, 40, 40, width / 2, height / 2) - ag.fillRect(0, 0, 1, 20, 30, width / 2, height / 2) - local rot = ag.elapsedTime() / 10 - ag.drawImage(50, 50, 80, 160, crate_texture, rot) +-- ag.drawLine(1, 0, 0.3, 10, 10, 40, 60) +-- ag.drawLine(1, 0.7, 1, 50, 10, 100, 60, 5) +-- ag.drawRect(0, 1, 0, 40, 40, width / 2, height / 2) +-- ag.fillRect(0, 0, 1, 20, 30, width / 2, height / 2) +-- local rot = ag.elapsedTime() / 10 +-- ag.drawImage(50, 50, 80, 160, crate_texture, rot) end