diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp index a67fe4b76cde77a3ab26d8a7708f1aa3a94fc9eb..550476859f8574b0b1ba7476c46775f1690b2489 100644 --- a/src/pulsaranimationwidget.cpp +++ b/src/pulsaranimationwidget.cpp @@ -268,17 +268,7 @@ void PulsarAnimationWidget::paintGL() { glLoadIdentity(); - // draw copyright info - glColor4f(1.0f, 1.0f, 1.0f, 0.5f); - QFont font; - font.setPointSize(11); - font.setBold(true); - font.setFamily("Arial"); - font.setStyleStrategy((QFont::StyleStrategy) (QFont::OpenGLCompatible | QFont::PreferQuality)); - renderText(10, 25, -100, QString::fromLocal8Bit("Copyright © 2009-2010"), font); - renderText(10, 10, -100, QString::fromLocal8Bit("Max-Planck-Insitut für Gravitationsphysik"), font); - - // draw backdrop + // draw backdrop first so that foreground alpha blending works correctly glColor3f(1.0f, 1.0f, 1.0f); glTranslatef(0.0, 0.0, -501.0); drawTexture(QPointF(0.0, 0.0), m_backgroundTexture); @@ -514,7 +504,34 @@ void PulsarAnimationWidget::paintGL() glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + // save current state (the following is using parallel projection) + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + { + glLoadIdentity(); + glOrtho(0, width(), 0, height(), 0.1, 501.0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + { + glLoadIdentity(); + // draw copyright info last (appears in front of everything) + glColor4f(1.0f, 1.0f, 1.0f, 0.5f); + QFont font; + font.setPointSize(11); + font.setBold(true); + font.setFamily("Arial"); + font.setStyleStrategy((QFont::StyleStrategy) (QFont::OpenGLCompatible | QFont::PreferQuality)); + renderText(10, 25, -100, QString::fromLocal8Bit("Copyright © 2009-2010"), font); + renderText(10, 10, -100, QString::fromLocal8Bit("Max-Planck-Insitut für Gravitationsphysik"), font); + + // restore original state + glMatrixMode(GL_PROJECTION); + } + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + } + glPopMatrix(); } void PulsarAnimationWidget::runAnimation()