Răsfoiți Sursa

Adds protection of the texture matrix stack which allows the user to use sf::Sprites with this code unmodified otherwise

Michael Bosse 8 ani în urmă
părinte
comite
0fca7e2045
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      demo/sfml_opengl2/nuklear_sfml_gl2.h

+ 5 - 0
demo/sfml_opengl2/nuklear_sfml_gl2.h

@@ -81,6 +81,9 @@ nk_sfml_render(enum nk_anti_aliasing AA)
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
     glViewport(0, 0, (GLsizei)window_width, (GLsizei)window_height);
+    glMatrixMode(GL_TEXTURE);
+    glPushMatrix();
+    glLoadIdentity();
     glMatrixMode(GL_PROJECTION);
     glPushMatrix();
     glLoadIdentity();
@@ -165,6 +168,8 @@ nk_sfml_render(enum nk_anti_aliasing AA)
     glDisable(GL_TEXTURE_2D);
 
     glBindTexture(GL_TEXTURE_2D, 0);
+    glMatrixMode(GL_TEXTURE);
+    glPopMatrix();
     glMatrixMode(GL_MODELVIEW);
     glPopMatrix();
     glMatrixMode(GL_PROJECTION);