Commit 99d8f06e authored by Oliver Bock's avatar Oliver Bock

Added preliminary background texture (rendering pending)

parent 2b4a20d6
......@@ -43,6 +43,9 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
m_quadricPulsarCone1 = NULL;
m_quadricPulsarCone2 = NULL;
m_pulsarTexture = NULL;
m_backgroundTexture = NULL;
m_framesPerSecond = 25;
resetParameters();
......@@ -64,6 +67,9 @@ PulsarAnimationWidget::~PulsarAnimationWidget()
if(m_quadricPulsar) gluDeleteQuadric(m_quadricPulsar);
if(m_quadricPulsarCone1) gluDeleteQuadric(m_quadricPulsarCone1);
if(m_quadricPulsarCone2) gluDeleteQuadric(m_quadricPulsarCone2);
if(m_pulsarTexture) deleteTexture(m_pulsarTexture);
if(m_backgroundTexture) deleteTexture(m_backgroundTexture);
}
void PulsarAnimationWidget::initializeGL()
......@@ -106,10 +112,11 @@ void PulsarAnimationWidget::initializeGL()
gluQuadricNormals(m_quadricPulsarCone1, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarCone2, GLU_SMOOTH);
// load pulsar texture
// load textures
m_pulsarTexture = bindTexture(QImage(":/textures/resources/texture_pulsar.png"), GL_TEXTURE_2D, GL_RGBA);
m_backgroundTexture = bindTexture(QImage(":/textures/resources/texture_background.png"), GL_TEXTURE_2D, GL_RGBA);
// use mipmap filter
// use mipmapped textures
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
......
......@@ -72,6 +72,7 @@ protected:
GLUquadricObj *m_quadricPulsarCone2;
GLuint m_pulsarTexture;
GLuint m_backgroundTexture;
int m_framesPerSecond;
......
......@@ -10,6 +10,7 @@
<file>resources/aei-icon48.png</file>
</qresource>
<qresource prefix="textures" >
<file>resources/texture_background.png</file>
<file>resources/texture_pulsar.png</file>
</qresource>
</RCC>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment