Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r--source/gameengine/GamePlayer/common/CMakeLists.txt1
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Canvas.h18
-rw-r--r--source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp19
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RenderTools.cpp14
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RenderTools.h15
-rw-r--r--source/gameengine/GamePlayer/common/Makefile1
-rw-r--r--source/gameengine/GamePlayer/common/SConscript3
-rw-r--r--source/gameengine/GamePlayer/ghost/CMakeLists.txt1
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp43
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.h1
-rw-r--r--source/gameengine/GamePlayer/ghost/Makefile1
-rw-r--r--source/gameengine/GamePlayer/ghost/SConscript3
12 files changed, 33 insertions, 87 deletions
diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt
index 29cdcd640f5..e26f8b9d69a 100644
--- a/source/gameengine/GamePlayer/common/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/common/CMakeLists.txt
@@ -69,6 +69,7 @@ SET(INC
../../../../source/gameengine/GamePlayer/ghost
../../../../source/blender/misc
../../../../source/blender/blenloader
+ ../../../../extern/glew/include
${PYTHON_INC}
${SOLID_INC}
${PNG_INC}
diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h
index bd66c865988..f82166dfa88 100644
--- a/source/gameengine/GamePlayer/common/GPC_Canvas.h
+++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h
@@ -33,18 +33,12 @@
#include "RAS_ICanvas.h"
#include "RAS_Rect.h"
-#if defined(WIN32) || defined(__APPLE__)
- #ifdef WIN32
- #pragma warning (disable:4786) // suppress stl-MSVC debug info warning
- #include <windows.h>
- #include <GL/gl.h>
- #else // WIN32
- // __APPLE__ is defined
- #include <AGL/gl.h>
- #endif // WIN32
-#else //defined(WIN32) || defined(__APPLE__)
- #include <GL/gl.h>
-#endif //defined(WIN32) || defined(__APPLE__)
+#ifdef WIN32
+ #pragma warning (disable:4786) // suppress stl-MSVC debug info warning
+ #include <windows.h>
+#endif // WIN32
+
+#include "GL/glew.h"
#include <map>
diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
index c2f15aefe16..b1e2b5af0e6 100644
--- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
@@ -31,23 +31,7 @@
#include <config.h>
#endif
-#ifdef WIN32
-#include <windows.h>
-#endif // WIN32
-#ifdef __APPLE__
-#define GL_GLEXT_LEGACY 1
-#include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
-#else
-#include <GL/gl.h>
-#if defined(__sun__) && !defined(__sparc__)
-#include <mesa/glu.h>
-#else
-#include <GL/glu.h>
-#endif
-#endif
-
-
+#include "GL/glew.h"
#include "GPC_PolygonMaterial.h"
#include "MT_Vector3.h"
@@ -88,7 +72,6 @@ static int fDoMipMap = 1;
static int fLinearMipMap=1;
static int fAlphamode= -1;
-using namespace bgl;
/* (n&(n-1)) zeros the least significant bit of n */
static int is_pow2(int num) {
return ((num)&(num-1))==0;
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
index 885981a2898..44eeccedbd1 100644
--- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
@@ -34,12 +34,8 @@
#include <windows.h>
#endif
-#ifdef __APPLE__
-#define GL_GLEXT_LEGACY 1
-#include <OpenGL/gl.h>
-#else
-#include <GL/gl.h>
-#endif
+#include "GL/glew.h"
+
#include <iostream>
#include "GPC_RenderTools.h"
@@ -137,10 +133,6 @@ int GPC_RenderTools::ProcessLighting(int layer)
{
if (m_clientobject)
{
- if (layer == RAS_LIGHT_OBJECT_LAYER)
- {
- layer = static_cast<KX_GameObject*>(m_clientobject)->GetLayer();
- }
if (applyLights(layer))
{
EnableOpenGLLights();
@@ -160,7 +152,7 @@ void GPC_RenderTools::EnableOpenGLLights()
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
- if (bgl::QueryExtension(bgl::_GL_EXT_separate_specular_color) || bgl::QueryVersion(1, 2))
+ if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2)
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
}
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h
index ee0212da643..f7230cb0865 100644
--- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h
+++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h
@@ -30,18 +30,11 @@
#ifndef __GPC_RENDERTOOLS_H
#define __GPC_RENDERTOOLS_H
-#if defined(WIN32) || defined(__APPLE__)
- #ifdef WIN32
- #include <windows.h>
- #include <GL/gl.h>
- #else // WIN32
- // __APPLE__ is defined
- #include <AGL/gl.h>
- #endif // WIN32
-#else //defined(WIN32) || defined(__APPLE__)
- #include <GL/gl.h>
-#endif //defined(WIN32) || defined(__APPLE__)
+#ifdef WIN32
+ #include <windows.h>
+#endif // WIN32
+#include "GL/glew.h"
#include "RAS_IRenderTools.h"
diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile
index 508dee18755..19d792ddbdb 100644
--- a/source/gameengine/GamePlayer/common/Makefile
+++ b/source/gameengine/GamePlayer/common/Makefile
@@ -35,6 +35,7 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I../../../blender/blenkernel
diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript
index 6ff3ae10735..3b2367d2592 100644
--- a/source/gameengine/GamePlayer/common/SConscript
+++ b/source/gameengine/GamePlayer/common/SConscript
@@ -45,7 +45,8 @@ incs = ['.',
'#source/gameengine/Network/LoopBackNetwork',
'#source/gameengine/GamePlayer/ghost',
'#source/blender/misc',
- '#source/blender/blenloader']
+ '#source/blender/blenloader',
+ '#extern/glew/include']
#This is all plugin stuff!
#if sys.platform=='win32':
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index 3d17cd2cfdd..d9f0675001f 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -65,6 +65,7 @@ SET(INC
../../../../source/blender/misc
../../../../source/blender/blenloader
../../../../extern/solid
+ ../../../../extern/glew/include
${PYTHON_INC}
)
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index dfd15227501..c4cf698d5ee 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -37,18 +37,7 @@
#include <windows.h>
#endif
-#ifdef __APPLE__
-#define GL_GLEXT_LEGACY 1
-#include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
-#else
-#include <GL/gl.h>
-#if defined(__sun__) && !defined(__sparc__)
-#include <mesa/glu.h>
-#else
-#include <GL/glu.h>
-#endif
-#endif
+#include "GL/glew.h"
#include "GPG_Application.h"
@@ -134,7 +123,8 @@ GPG_Application::GPG_Application(GHOST_ISystem* system, struct Main* maggie, STR
m_sceneconverter(0),
m_networkdevice(0),
m_audiodevice(0),
- m_blendermat(0)
+ m_blendermat(0),
+ m_blenderglslmat(0)
{
fSystem = system;
}
@@ -487,7 +477,8 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
{
if (!m_engineInitialized)
{
- bgl::InitExtensions(1);
+ glewInit();
+ bgl::InitExtensions(true);
// get and set the preferences
SYS_SystemHandle syshandle = SYS_GetSystem();
@@ -508,26 +499,10 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
bool useVertexArrays = SYS_GetCommandLineInt(syshandle,"vertexarrays",1) != 0;
bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DIAPLAY_LISTS) != 0);
-#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT)
- if (!getenv("WITHOUT_GLEXT")) {
+ if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) {
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 {
- m_blendermat=0;
+ m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", gameflag) != 0);
}
-#else
- m_blendermat=0;
-#endif//GL_ARB_multitexture
- // ----------------------------------
// create the canvas, rasterizer and rendertools
m_canvas = new GPG_Canvas(window);
@@ -545,7 +520,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
} else {
m_rasterizer = new RAS_ListRasterizer(m_canvas);
}
- else if (useVertexArrays && bgl::QueryVersion(1, 1))
+ else if (useVertexArrays && GLEW_VERSION_1_1)
m_rasterizer = new RAS_VAOpenGLRasterizer(m_canvas);
else
m_rasterizer = new RAS_OpenGLRasterizer(m_canvas);
@@ -655,6 +630,8 @@ bool GPG_Application::startEngine(void)
// sceneconverter->SetAlwaysUseExpandFraming(true);
if(m_blendermat)
m_sceneconverter->SetMaterials(true);
+ if(m_blenderglslmat)
+ m_sceneconverter->SetGLSLMaterials(true);
KX_Scene* startscene = new KX_Scene(m_keyboard,
m_mouse,
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h
index 024ca1dbf32..17f5add8b19 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h
@@ -141,6 +141,7 @@ protected:
SND_IAudioDevice* m_audiodevice;
bool m_blendermat;
+ bool m_blenderglslmat;
};
diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile
index d5aae181396..13940ac3fc8 100644
--- a/source/gameengine/GamePlayer/ghost/Makefile
+++ b/source/gameengine/GamePlayer/ghost/Makefile
@@ -36,6 +36,7 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
# OpenGL header files
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_BMFONT)/include
diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript
index bd37777031e..f3cce6c7443 100644
--- a/source/gameengine/GamePlayer/ghost/SConscript
+++ b/source/gameengine/GamePlayer/ghost/SConscript
@@ -39,7 +39,8 @@ incs = ['.',
'#source/gameengine/Network/LoopBackNetwork',
'#source/gameengine/GamePlayer/common',
'#source/blender/misc',
- '#source/blender/blenloader']
+ '#source/blender/blenloader',
+ '#extern/glew/include']
incs += Split(env['BF_PYTHON_INC'])
incs += Split(env['BF_SOLID_INC'])