diff options
author | Kent Mein <mein@cs.umn.edu> | 2008-04-16 21:40:59 +0400 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2008-04-16 21:40:59 +0400 |
commit | 867e12836b746b174743d0500e39343e1adb1b7f (patch) | |
tree | 36f42a00eb4ab505eca0c2d67c26c85ed78a9e7e /source/gameengine/GamePlayer | |
parent | d482b3285cdbfc85b5031fc7223b8ffe96619562 (diff) |
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
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r-- | source/gameengine/GamePlayer/common/Makefile | 4 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 28 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/Makefile | 3 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/SConscript | 4 |
4 files changed, 28 insertions, 11 deletions
diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile index 5b61fb4f902..10d7543b624 100644 --- a/source/gameengine/GamePlayer/common/Makefile +++ b/source/gameengine/GamePlayer/common/Makefile @@ -73,6 +73,10 @@ CPPFLAGS += -I../../../gameengine/Rasterizer/RAS_OpenGLRasterizer CPPFLAGS += -I../../../gameengine/Physics/Sumo CPPFLAGS += -I../../../gameengine/Physics/common +ifeq ($(WITH_BF_GLEXT),true) + CPPFLAGS += -DWITH_GLEXT +endif + ############################### SOURCEDIR = source/gameengine/GamePlayer/common 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 <iostream> #include <MT_assert.h> +#include <stdlib.h> /********************************** * 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 // ---------------------------------- diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile index 857b274cbae..3c32079c652 100644 --- a/source/gameengine/GamePlayer/ghost/Makefile +++ b/source/gameengine/GamePlayer/ghost/Makefile @@ -80,4 +80,7 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_GHOST)/include CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) +ifeq ($(WITH_BF_GLEXT),true) + CPPFLAGS += -DWITH_GLEXT +endif diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index f76e926e6d4..cc2d7de8002 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -46,4 +46,8 @@ cflags = [] if env['OURPLATFORM']=='win32-vc': cflags = ['/GR'] +if env['WITH_BF_GLEXT'] == 1: + env['CPPFLAGS'].append('-DWITH_GLEXT') + + env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = [], libtype='player',priority=0, compileflags=cflags) |