diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-05-07 21:44:46 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-05-07 21:44:46 +0400 |
commit | 57932e1752ea0d9b9b0f3f69327bca83297d7e07 (patch) | |
tree | 0ee57c9d36089c68113e0db92fa2b8c915c5bf14 /source/gameengine/GamePlayer/ghost/GPG_Application.cpp | |
parent | 2f4ca518ea468f6c2e06a70aa24f16cf8a141425 (diff) | |
parent | 529a8bb949412ac5cc7203fd583e4f0b28282ddf (diff) |
svn merge -r 13452:14721 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/gameengine/GamePlayer/ghost/GPG_Application.cpp')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 4f6c78a0fd8..dfd15227501 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -1,15 +1,12 @@ /** * $Id$ * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,7 +24,7 @@ * * Contributor(s): none yet. * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** + * ***** END GPL LICENSE BLOCK ***** * GHOST Blender Player application implementation file. */ @@ -57,6 +54,7 @@ #include <iostream> #include <MT_assert.h> +#include <stdlib.h> /********************************** * Begin Blender include block @@ -509,20 +507,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 // ---------------------------------- @@ -537,7 +540,11 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) goto initFailed; if(useLists) - m_rasterizer = new RAS_ListRasterizer(m_canvas); + if (useVertexArrays) { + m_rasterizer = new RAS_ListRasterizer(m_canvas, true); + } else { + m_rasterizer = new RAS_ListRasterizer(m_canvas); + } else if (useVertexArrays && bgl::QueryVersion(1, 1)) m_rasterizer = new RAS_VAOpenGLRasterizer(m_canvas); else @@ -841,11 +848,12 @@ bool GPG_Application::handleKey(GHOST_IEvent* event, bool isDown) { GHOST_TEventDataPtr eventData = ((GHOST_IEvent*)event)->getData(); GHOST_TEventKeyData* keyData = static_cast<GHOST_TEventKeyData*>(eventData); - if (fSystem->getFullScreen()) { - if (keyData->key == GHOST_kKeyEsc) { + //no need for this test + //if (fSystem->getFullScreen()) { + if (keyData->key == GHOST_kKeyEsc && !m_keyboard->m_hookesc) { m_exitRequested = KX_EXIT_REQUEST_OUTSIDE; } - } + //} m_keyboard->ConvertEvent(keyData->key, isDown); handled = true; } |