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
f59e10fc
Commit
f59e10fc
authored
Sep 11, 2011
by
Oliver Bock
Browse files
Draw background first (correct z-order)
parent
f854b712
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pulsaranimationwidget.cpp
View file @
f59e10fc
...
...
@@ -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.5
f
);
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
};
...
...
Write
Preview
Markdown
is supported
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