diff options
Diffstat (limited to 'source/gameengine/BlenderRoutines/KX_BlenderGL.cpp')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 50751be7c7d..af367f1797e 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -48,6 +48,17 @@ #include "BMF_Api.h" +#ifdef __APPLE__ +#define GL_GLEXT_LEGACY 1 +#include <OpenGL/gl.h> +#include <OpenGL/glu.h> +#else +#include <GL/gl.h> +#include <GL/glu.h> +#endif +#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h" +#include "RAS_OpenGLRasterizer/ARB_multitexture.h" +#include "BL_Material.h" // MAXTEX /* Data types encoding the game world: */ #include "DNA_object_types.h" @@ -166,10 +177,39 @@ void BL_RenderText(int mode,const char* textstr,int textlen,struct TFace* tface, } +void DisableForText() +{ + if(glIsEnabled(GL_BLEND)) + glDisable(GL_BLEND); + + if(glIsEnabled(GL_LIGHTING)) { + glDisable(GL_LIGHTING); + glDisable(GL_COLOR_MATERIAL); + } +#ifdef GL_ARB_multitexture + for(int i=0; i<MAXTEX; i++) { + if(bgl::RAS_EXT_support._ARB_multitexture) + bgl::blActiveTextureARB(GL_TEXTURE0_ARB+i); +#ifdef GL_ARB_texture_cube_map + if(bgl::RAS_EXT_support._ARB_texture_cube_map) + if(glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) + glDisable(GL_TEXTURE_CUBE_MAP_ARB); +#endif + if(glIsEnabled(GL_TEXTURE_2D)) + glDisable(GL_TEXTURE_2D); + } +#else//GL_ARB_multitexture + if(glIsEnabled(GL_TEXTURE_2D)) + glDisable(GL_TEXTURE_2D); +#endif +} + + void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height) { /* gl prepping */ - glDisable(GL_TEXTURE_2D); + DisableForText(); + //glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -204,7 +244,8 @@ void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int /* This is a rather important line :( The gl-mode hasn't been left * behind quite as neatly as we'd have wanted to. I don't know * what cause it, though :/ .*/ - glDisable(GL_TEXTURE_2D); + DisableForText(); + //glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); glPushMatrix(); |