diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp index aac209f0b419991cba2dfeb3e2177c6231c37818..c718c760da775ad1cbf15301c21db340f68c53da 100644 --- a/src/pulsaranimationwidget.cpp +++ b/src/pulsaranimationwidget.cpp @@ -229,6 +229,30 @@ void PulsarAnimationWidget::paintGL() 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); + // 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 backdrop (independent parallel projection) + glColor3f(0.5, 0.5, 0.5f); + glTranslatef(0.0, 0.0, -501.0); + drawTexture(QPointF(0.0, 0.0), m_backgroundTexture); + + // restore original state + glMatrixMode(GL_PROJECTION); + } + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + } + glPopMatrix(); + // TODO: should be located elsewhere static GLfloat no_mat[] = {0.0, 0.0, 0.0, 1.0}; static GLfloat mat_diffuse[] = {0.5, 0.5, 0.5, 1.0};