From 867e12836b746b174743d0500e39343e1adb1b7f Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Wed, 16 Apr 2008 17:40:59 +0000 Subject: This patch spawns from this game engine issue: [#7113] GE crash pressing as soon as P on 64 bit Note: glext.h has been removed from the source If you get errors compiling with it you have 2 options download/install glext.h (preferred method) or set WITH_BF_GLEXT=false If your a user and having problems with game engine try setting the env var: WITHOUT_GLEXT 1 Kent --- .../GamePlayer/ghost/GPG_Application.cpp | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'source/gameengine/GamePlayer/ghost/GPG_Application.cpp') diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index dcc70db9eed..0fd1812cb3c 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -57,6 +57,7 @@ #include #include +#include /********************************** * Begin Blender include block @@ -509,20 +510,25 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); bool useVertexArrays = SYS_GetCommandLineInt(syshandle,"vertexarrays",1) != 0; bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DIAPLAY_LISTS) != 0); -#ifdef GL_ARB_multitexture - int gameflag =(G.fileflags & G_FILE_GAME_MAT); - // ---------------------------------- - if(bgl::RAS_EXT_support._ARB_multitexture && bgl::QueryVersion(1, 1)) { - m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", gameflag) != 0); - int unitmax=0; - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&unitmax); - bgl::max_texture_units = MAXTEX>unitmax?unitmax:MAXTEX; - //std::cout << "using(" << bgl::max_texture_units << ") of(" << unitmax << ") texture units." << std::endl; + +#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) + if (!getenv("WITHOUT_GLEXT")) { + int gameflag =(G.fileflags & G_FILE_GAME_MAT); + + if(bgl::RAS_EXT_support._ARB_multitexture && bgl::QueryVersion(1, 1)) { + m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", gameflag) != 0); + int unitmax=0; + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&unitmax); + bgl::max_texture_units = MAXTEX>unitmax?unitmax:MAXTEX; + //std::cout << "using(" << bgl::max_texture_units << ") of(" << unitmax << ") texture units." << std::endl; + } else { + bgl::max_texture_units = 0; + } } else { - bgl::max_texture_units = 0; + m_blendermat=0; } #else - m_blendermat=0; + m_blendermat=0; #endif//GL_ARB_multitexture // ---------------------------------- -- cgit v1.2.3