diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-10 20:52:19 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-10 20:52:19 (GMT) |
commit | a003a02f8ae4f5bc14cbed9249b0fbfefdd2fd07 (patch) | |
tree | 8f3f61a0b2371a122c90835466895a45d4f7659a /Smoke/renderer_gl.c | |
parent | f9e23896d3525e3dfe710585f6a88858cb88f8c6 (diff) | |
download | 2iv35-a003a02f8ae4f5bc14cbed9249b0fbfefdd2fd07.zip 2iv35-a003a02f8ae4f5bc14cbed9249b0fbfefdd2fd07.tar.gz 2iv35-a003a02f8ae4f5bc14cbed9249b0fbfefdd2fd07.tar.bz2 |
fx or vy get/setters added. mem probs fixed
Diffstat (limited to 'Smoke/renderer_gl.c')
-rw-r--r-- | Smoke/renderer_gl.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/Smoke/renderer_gl.c b/Smoke/renderer_gl.c index 01205fe..8cc2095 100644 --- a/Smoke/renderer_gl.c +++ b/Smoke/renderer_gl.c @@ -572,9 +572,10 @@ static void render_glyphs(void) float scale, idxcf, idxrf; struct color4f color; fftw_real *frame_color; - struct fftw_real_xy_p frames_direction; + struct fftw_real_xy frames_direction; + GLUquadricObj *qobj; - GLUquadricObj *qobj = gluNewQuadric(); + qobj = gluNewQuadric(); gluQuadricDrawStyle(qobj, GLU_FILL); gluQuadricNormals(qobj, GLU_SMOOTH); @@ -597,7 +598,7 @@ static void render_glyphs(void) render_glyph(qobj, frames_direction.x[idx], frames_direction.y[idx], i, j); } } - + gluDeleteQuadric(qobj); } @@ -971,7 +972,6 @@ void visualize(struct vis_data_arrays *vis_data) if (renderer_render_grid) { render_grid(); } - if (smoke_get_render()) { if (smoke_get_sort() == SMOKE_FLUID) @@ -1011,32 +1011,31 @@ void visualize(struct vis_data_arrays *vis_data) } render_streamlines(); + //create an orthographic projection matrix for rendering the legendbar + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + + glLoadIdentity(); + + //create an orthographic viewing volume with the same dimensions as the + //window in front of the previous viewing volume + //from znear = 0.0 to zfar = 1.0 + glOrtho(0.0, (GLfloat)winWidth, 0.0, (GLfloat)winHeight, 0.0, 1.0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); //save the current modelview matrix + + glLoadIdentity(); + + //now render the legendbar + render_legend(); + + //restore the previous modelview matrix + glPopMatrix(); + + //restore the previous projection matrix + glMatrixMode(GL_PROJECTION); - //create an orthographic projection matrix for rendering the legendbar
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
-
- glLoadIdentity();
-
- //create an orthographic viewing volume with the same dimensions as the
- //window in front of the previous viewing volume
- //from znear = 0.0 to zfar = 1.0
- glOrtho(0.0, (GLfloat)winWidth, 0.0, (GLfloat)winHeight, 0.0, 1.0);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix(); //save the current modelview matrix
-
- glLoadIdentity();
-
- //now render the legendbar
- render_legend();
-
- //restore the previous modelview matrix
- glPopMatrix();
-
- //restore the previous projection matrix
- glMatrixMode(GL_PROJECTION);
-
- glPopMatrix();
+ glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); |