diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2012-02-14 22:23:58 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2012-02-14 22:23:58 +0400 |
commit | 91058355cc0508ed938aa1cb2d1f35bb1b529cf6 (patch) | |
tree | 1af05ad8897335a5954efd44ed85c5b5f3336fea | |
parent | 001299a0f670b4852d9eb50d7042d3c3a54dcf7f (diff) |
font objects in blenderplayer fail when object with alpha is rendered
the embed bge has its own DisableForText() routine which prepares the GL flags for the text render.
For some reason blenderplayer is taking a slim approach and going straight for the rendering. This routine helps to address this bug/case (non reported, foundin my own project files). If need arises we should move this to its own routine incorporating the other GL tests the embed bge performs.
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 55e3220c08c..54e2efd8776 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -291,6 +291,29 @@ void GPC_RenderTools::RenderText3D( int fontid, double* mat, float aspect) { + 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); + + if(glIsEnabled(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); + + if(glIsEnabled(GL_TEXTURE_2D)) + glDisable(GL_TEXTURE_2D); + } + /* the actual drawing */ glColor4fv(color); |