diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-11-22 10:11:05 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-11-22 10:11:05 +0400 |
commit | 6577117c4e6f7977602c67fa4f673c311efbe88c (patch) | |
tree | d73aa5d03ec908e00b4a85e031296569cce65ab3 /source/gameengine/BlenderRoutines | |
parent | b7f5c1c121724964c6c2269c05eedd04a78e7a74 (diff) |
BGE: Removing some glIsEnabled() calls from DisableForText() in KX_BlenderGL.cpp. Use of glIsEnabled() is discouraged since it causes a potential sync with the graphics card. Also, it's faster to just always use glDisable() (even if that feature is already disabled) then to check if it's enabled first.
Diffstat (limited to 'source/gameengine/BlenderRoutines')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 7c4c759e361..00836fa8ecb 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -95,35 +95,29 @@ static void DisableForText() { glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* needed for texture fonts otherwise they render as wireframe */ - if (glIsEnabled(GL_BLEND)) glDisable(GL_BLEND); - if (glIsEnabled(GL_ALPHA_TEST)) glDisable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); - if (glIsEnabled(GL_LIGHTING)) { - glDisable(GL_LIGHTING); - glDisable(GL_COLOR_MATERIAL); - } + glDisable(GL_LIGHTING); + glDisable(GL_COLOR_MATERIAL); if (GLEW_ARB_multitexture) { for (int i=0; i<MAXTEX; i++) { glActiveTextureARB(GL_TEXTURE0_ARB+i); if (GLEW_ARB_texture_cube_map) - if (glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) - glDisable(GL_TEXTURE_CUBE_MAP_ARB); + glDisable(GL_TEXTURE_CUBE_MAP_ARB); - if (glIsEnabled(GL_TEXTURE_2D)) - glDisable(GL_TEXTURE_2D); + glDisable(GL_TEXTURE_2D); } glActiveTextureARB(GL_TEXTURE0_ARB); } else { if (GLEW_ARB_texture_cube_map) - if (glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) - glDisable(GL_TEXTURE_CUBE_MAP_ARB); + glDisable(GL_TEXTURE_CUBE_MAP_ARB); - if (glIsEnabled(GL_TEXTURE_2D)) - glDisable(GL_TEXTURE_2D); + glDisable(GL_TEXTURE_2D); } } |