Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
pulsatingscience
Commits
99d8f06e
Commit
99d8f06e
authored
Jan 23, 2009
by
Oliver Bock
Browse files
Added preliminary background texture (rendering pending)
parent
2b4a20d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/pulsaranimationwidget.cpp
View file @
99d8f06e
...
...
@@ -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 texture
s
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 mipmap
ped textures
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR_MIPMAP_NEAREST
);
...
...
src/pulsaranimationwidget.h
View file @
99d8f06e
...
...
@@ -72,6 +72,7 @@ protected:
GLUquadricObj
*
m_quadricPulsarCone2
;
GLuint
m_pulsarTexture
;
GLuint
m_backgroundTexture
;
int
m_framesPerSecond
;
...
...
src/pulsatingscience.qrc
View file @
99d8f06e
...
...
@@ -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>
src/resources/texture_background.png
0 → 100644
View file @
99d8f06e
36.2 KB
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment