diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-08-07 19:16:38 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-08-07 19:16:38 +0200 |
| commit | a98aaecf976f46300383b85041f13962ab604147 (patch) | |
| tree | 0fec1ad42b078e353953f143a2bdb9075c46daff /src/gl_draw.cxx | |
| parent | f85ee3541a085b31a0805e74b43d4e60f960f9be (diff) | |
Fix for Broken "cube" demo (#762)
This commit fixes an error in the cube demo appearing specifically with the AMD Radeon GPU.
Diffstat (limited to 'src/gl_draw.cxx')
| -rw-r--r-- | src/gl_draw.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx index e6adaa1c7..82ee2b95d 100644 --- a/src/gl_draw.cxx +++ b/src/gl_draw.cxx @@ -336,9 +336,12 @@ static gl_texture_fifo *gl_fifo = NULL; // points to the texture pile class inst // displays a pre-computed texture on the GL scene void gl_texture_fifo::display_texture(int rank) { + // GL_TRANSFORM_BIT for GL_PROJECTION and GL_MODELVIEW + // GL_ENABLE_BIT for GL_DEPTH_TEST, GL_LIGHTING + // GL_TEXTURE_BIT for GL_TEXTURE_RECTANGLE_ARB + // GL_COLOR_BUFFER_BIT for GL_BLEND and glBlendFunc, + glPushAttrib(GL_TRANSFORM_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT); //setup matrices - GLint matrixMode; - glGetIntegerv (GL_MATRIX_MODE, &matrixMode); glMatrixMode (GL_PROJECTION); glPushMatrix(); glLoadIdentity (); @@ -347,8 +350,6 @@ void gl_texture_fifo::display_texture(int rank) glLoadIdentity (); float winw = Fl_Gl_Window_Driver::gl_scale * Fl_Window::current()->w(); float winh = Fl_Gl_Window_Driver::gl_scale * Fl_Window::current()->h(); - // GL_COLOR_BUFFER_BIT for glBlendFunc, GL_ENABLE_BIT for glEnable / glDisable - glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT); glDisable (GL_DEPTH_TEST); // ensure text is not removed by depth buffer test. glEnable (GL_BLEND); // for text fading glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -381,13 +382,12 @@ void gl_texture_fifo::display_texture(int rank) glTexCoord2f ((GLfloat)width, 0.0f); // draw lower right in world coordinates glVertex2f (ox + width, oy); glEnd (); - glPopAttrib(); // reset original matrices glPopMatrix(); // GL_MODELVIEW glMatrixMode (GL_PROJECTION); glPopMatrix(); - glMatrixMode (matrixMode); + glPopAttrib(); // GL_TRANSFORM_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT #if HAVE_GL_GLU_H //set the raster position to end of string pos[0] += width; |
