diff options
Diffstat (limited to 'source')
154 files changed, 668 insertions, 262 deletions
diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt index 2debe516dd7..346d5bc64b8 100644 --- a/source/blender/blenfont/CMakeLists.txt +++ b/source/blender/blenfont/CMakeLists.txt @@ -26,11 +26,13 @@ set(INC ../blenkernel ../blenlib ../editors/include + ../gpu ../makesdna ../makesrna ../python ../imbuf ../../../intern/guardedalloc + ../../../intern/glew-mx ../../../intern/locale ) @@ -58,7 +60,7 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) blender_add_lib(bf_blenfont "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript index 1c573fa4a59..b6cf052a980 100644 --- a/source/blender/blenfont/SConscript +++ b/source/blender/blenfont/SConscript @@ -35,10 +35,12 @@ incs = [ 'intern', '#/intern/guardedalloc', '#/intern/locale', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../blenkernel', '../blenlib', '../editors/include', + '../gpu', '../imbuf', '../makesdna', '../makesrna', @@ -47,7 +49,7 @@ incs = [ incs.extend(Split(env['BF_FREETYPE_INC'])) -defs = ['GLEW_STATIC'] +defs = env['BF_GL_DEFINITIONS'] if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross': defs.append('_WIN32') diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index fd201fed9e7..f4a3a0c10dd 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -38,6 +38,7 @@ set(INC ../nodes ../render/extern/include ../../../intern/guardedalloc + ../../../intern/glew-mx ../../../intern/iksolver/extern ../../../intern/memutil ../../../intern/mikktspace @@ -272,7 +273,7 @@ set(SRC intern/pbvh_intern.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_AUDASPACE) list(APPEND INC diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index 25f8422afed..9243c85167b 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -45,7 +45,8 @@ incs = [ '#/intern/raskter', '#/intern/rigidbody', '#/extern/bullet2/src', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/audaspace/intern', '#/intern/elbeem/extern', '#/intern/iksolver/extern', @@ -65,14 +66,11 @@ incs = [ '../nodes', '../render/extern/include', '../windowmanager', - env['BF_OPENGL_INC'], env['BF_ZLIB_INC'], ] incs = ' '.join(incs) -defs = [ - 'GLEW_STATIC', - ] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_SMOKE']: defs.append('WITH_SMOKE') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 3aa4e0abbba..81c03d8081b 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -72,11 +72,10 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm); #include "BLI_sys_types.h" /* for intptr_t support */ -#include "GL/glew.h" - #include "GPU_buffers.h" #include "GPU_draw.h" #include "GPU_extensions.h" +#include "GPU_glew.h" #include "GPU_material.h" /* very slow! enable for testing only! */ diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index cad062ac63d..bfc70c91181 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -34,8 +34,6 @@ * \ingroup bke */ -#include "GL/glew.h" - #include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_edgehash.h" @@ -62,6 +60,7 @@ #include "GPU_buffers.h" #include "GPU_draw.h" #include "GPU_extensions.h" +#include "GPU_glew.h" #include "GPU_material.h" #include <string.h> diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 40a4bc22ce9..ce7804d9878 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -41,8 +41,6 @@ * is likely to be a little slow. */ -#include "GL/glew.h" - #include "BLI_math.h" #include "BLI_jitter.h" #include "BLI_bitmap.h" @@ -58,6 +56,7 @@ #include "MEM_guardedalloc.h" #include "GPU_extensions.h" +#include "GPU_glew.h" extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */ diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index ccedb6f6b71..3e763016efb 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1644,7 +1644,7 @@ void BKE_pbvh_raycast_project_ray_root (PBVH *bvh, bool original, float ray_star } -//#include <GL/glew.h> +//#include "GPU_glew.h" typedef struct { DMSetMaterial setMaterial; diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 89245d2300d..90ac712e55a 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -33,8 +33,6 @@ /* Part of the code copied from elbeem fluid library, copyright by Nils Thuerey */ -#include <GL/glew.h> - #include "MEM_guardedalloc.h" #include <float.h> @@ -84,6 +82,8 @@ #include "RE_shader_ext.h" +#include "GPU_glew.h" + /* UNUSED so far, may be enabled later */ /* #define USE_SMOKE_COLLISION_DM */ diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 2e96eecebcf..0bd9517dcfd 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -72,10 +72,9 @@ # include "BLI_array.h" #endif -#include "GL/glew.h" - #include "GPU_draw.h" #include "GPU_extensions.h" +#include "GPU_glew.h" #include "GPU_material.h" #include "CCGSubSurf.h" diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt index d6030a967d5..b9f50a6cdf1 100644 --- a/source/blender/editors/animation/CMakeLists.txt +++ b/source/blender/editors/animation/CMakeLists.txt @@ -23,10 +23,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -57,4 +59,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_animation "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/animation/SConscript b/source/blender/editors/animation/SConscript index 91d480978c4..ed4b794cbce 100644 --- a/source/blender/editors/animation/SConscript +++ b/source/blender/editors/animation/SConscript @@ -31,17 +31,19 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../makesdna', '../../makesrna', '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt index 9aa17f1e503..fc211f0e60b 100644 --- a/source/blender/editors/armature/CMakeLists.txt +++ b/source/blender/editors/armature/CMakeLists.txt @@ -23,11 +23,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager - ../../gpu ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -74,4 +75,6 @@ if(WITH_OPENNL) ) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_armature "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/armature/SConscript b/source/blender/editors/armature/SConscript index c68045c9398..97bc1a138b3 100644 --- a/source/blender/editors/armature/SConscript +++ b/source/blender/editors/armature/SConscript @@ -31,20 +31,21 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/opennl/extern', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../makesdna', '../../makesrna', - '../../gpu', '../../windowmanager', ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/editors/gpencil/CMakeLists.txt b/source/blender/editors/gpencil/CMakeLists.txt index 904ad4892ed..5dc9679777f 100644 --- a/source/blender/editors/gpencil/CMakeLists.txt +++ b/source/blender/editors/gpencil/CMakeLists.txt @@ -24,10 +24,12 @@ set(INC ../../blenkernel ../../blenlib ../../imbuf + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -50,4 +52,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_gpencil "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/gpencil/SConscript b/source/blender/editors/gpencil/SConscript index 8b891fcb8cf..ab42bad52dc 100644 --- a/source/blender/editors/gpencil/SConscript +++ b/source/blender/editors/gpencil/SConscript @@ -31,7 +31,8 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/elbeem/extern', '../include', '../../blenfont', @@ -46,7 +47,7 @@ incs = [ '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index 9fa603966b6..cd26bb22ada 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -33,7 +33,7 @@ #ifndef __BIF_GL_H__ #define __BIF_GL_H__ -#include "GL/glew.h" +#include "GPU_glew.h" #ifdef __APPLE__ diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index e13517adbb3..b921d17104c 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -30,6 +30,7 @@ set(INC ../../python ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -70,4 +71,6 @@ if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_interface "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/interface/SConscript b/source/blender/editors/interface/SConscript index 1936e17a7bb..303ab7ff286 100644 --- a/source/blender/editors/interface/SConscript +++ b/source/blender/editors/interface/SConscript @@ -31,7 +31,8 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', @@ -45,7 +46,7 @@ incs = [ '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/mask/CMakeLists.txt b/source/blender/editors/mask/CMakeLists.txt index b1cf6db3144..033d034cf4e 100644 --- a/source/blender/editors/mask/CMakeLists.txt +++ b/source/blender/editors/mask/CMakeLists.txt @@ -25,10 +25,12 @@ set(INC ../include ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -48,4 +50,6 @@ set(SRC mask_intern.h ) +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_mask "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/mask/SConscript b/source/blender/editors/mask/SConscript index 9dd521e3a7c..bcbaaa34960 100644 --- a/source/blender/editors/mask/SConscript +++ b/source/blender/editors/mask/SConscript @@ -29,14 +29,16 @@ Import ('env') sources = env.Glob('*.c') -defs = [] +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenkernel', '../../blenlib', + '../../gpu', '../../makesdna', '../../makesrna', '../../windowmanager', diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index 0cb2dd1eb68..db20d42f39d 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -32,6 +32,7 @@ set(INC ../../render/extern/include ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -86,4 +87,6 @@ if(WITH_BULLET) add_definitions(-DWITH_BULLET) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_mesh "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/mesh/SConscript b/source/blender/editors/mesh/SConscript index 6fa48c12eca..122a7501e58 100644 --- a/source/blender/editors/mesh/SConscript +++ b/source/blender/editors/mesh/SConscript @@ -29,11 +29,12 @@ Import ('env') sources = env.Glob('*.c') -defs = [] +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../uvedit', '../../blenfont', diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index 1bb35b65918..9b380ff8d48 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -33,10 +33,11 @@ set(INC ../../render/extern/include ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS - + ${GLEW_INCLUDE_PATH} ) set(SRC @@ -62,6 +63,8 @@ set(SRC object_intern.h ) +add_definitions(${GL_DEFINITIONS}) + if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) endif() diff --git a/source/blender/editors/physics/CMakeLists.txt b/source/blender/editors/physics/CMakeLists.txt index 892d71befb4..40d555226f3 100644 --- a/source/blender/editors/physics/CMakeLists.txt +++ b/source/blender/editors/physics/CMakeLists.txt @@ -23,11 +23,13 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/elbeem/extern ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -64,4 +66,6 @@ if(WITH_BULLET) add_definitions(-DWITH_BULLET) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_physics "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/physics/SConscript b/source/blender/editors/physics/SConscript index 9436280de43..983d1c4b4ba 100644 --- a/source/blender/editors/physics/SConscript +++ b/source/blender/editors/physics/SConscript @@ -31,20 +31,22 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/rigidbody', - '#/extern/glew/include', '#/intern/elbeem/extern', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../makesdna', '../../makesrna', '../../windowmanager', ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/editors/render/CMakeLists.txt b/source/blender/editors/render/CMakeLists.txt index 24015bd4ea3..42dafc076ed 100644 --- a/source/blender/editors/render/CMakeLists.txt +++ b/source/blender/editors/render/CMakeLists.txt @@ -32,6 +32,7 @@ set(INC ../../render/extern/include ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -64,6 +65,8 @@ if(WITH_HEADLESS) add_definitions(-DWITH_HEADLESS) endif() +add_definitions(${GL_DEFINITIONS}) + if(WITH_FREESTYLE) list(APPEND INC ../../freestyle diff --git a/source/blender/editors/render/SConscript b/source/blender/editors/render/SConscript index 41576f9b485..cbb7988695b 100644 --- a/source/blender/editors/render/SConscript +++ b/source/blender/editors/render/SConscript @@ -31,7 +31,8 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/elbeem/extern', '../include', '../../blenfont', @@ -48,7 +49,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index ecf5e962c80..559c86bf48c 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -31,8 +31,6 @@ #include <string.h> #include <stddef.h> -#include <GL/glew.h> - #include "MEM_guardedalloc.h" #include "BLI_math.h" @@ -69,6 +67,7 @@ #include "RNA_define.h" #include "GPU_extensions.h" +#include "GPU_glew.h" #include "wm_window.h" diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt index 4ff1767f582..413d40b9f9c 100644 --- a/source/blender/editors/screen/CMakeLists.txt +++ b/source/blender/editors/screen/CMakeLists.txt @@ -30,6 +30,7 @@ set(INC ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -51,4 +52,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_screen "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/screen/SConscript b/source/blender/editors/screen/SConscript index 28a6cbb02e6..f5442c7ea63 100644 --- a/source/blender/editors/screen/SConscript +++ b/source/blender/editors/screen/SConscript @@ -31,7 +31,8 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', @@ -45,7 +46,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/editors/sculpt_paint/CMakeLists.txt b/source/blender/editors/sculpt_paint/CMakeLists.txt index 18db57c9f21..0fa5f2d9837 100644 --- a/source/blender/editors/sculpt_paint/CMakeLists.txt +++ b/source/blender/editors/sculpt_paint/CMakeLists.txt @@ -32,6 +32,7 @@ set(INC ../../render/extern/include ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -64,4 +65,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_sculpt_paint "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/sculpt_paint/SConscript b/source/blender/editors/sculpt_paint/SConscript index b0118fbbf53..233f562fcc7 100644 --- a/source/blender/editors/sculpt_paint/SConscript +++ b/source/blender/editors/sculpt_paint/SConscript @@ -29,11 +29,12 @@ Import ('env') sources = env.Glob('*.c') -defs = [] +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../uvedit', '../../blenfont', diff --git a/source/blender/editors/space_action/CMakeLists.txt b/source/blender/editors/space_action/CMakeLists.txt index e0dc2709cf3..96a1e74c882 100644 --- a/source/blender/editors/space_action/CMakeLists.txt +++ b/source/blender/editors/space_action/CMakeLists.txt @@ -22,10 +22,12 @@ set(INC ../include ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -42,4 +44,6 @@ set(SRC action_intern.h ) +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_action "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_action/SConscript b/source/blender/editors/space_action/SConscript index 2776bd2989a..2e2081b3c6e 100644 --- a/source/blender/editors/space_action/SConscript +++ b/source/blender/editors/space_action/SConscript @@ -29,16 +29,20 @@ Import ('env') sources = env.Glob('*.c') +defs = env['BF_GL_DEFINITIONS'] + incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenkernel', '../../blenlib', + '../../gpu', '../../makesdna', '../../makesrna', '../../windowmanager', ] incs = ' '.join(incs) -env.BlenderLib ( 'bf_editors_space_action', sources, Split(incs), [], libtype=['core'], priority=[40] ) +env.BlenderLib ( 'bf_editors_space_action', sources, Split(incs), defs, libtype=['core'], priority=[40] ) diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt index 9e045a39a0c..01a099e3701 100644 --- a/source/blender/editors/space_buttons/CMakeLists.txt +++ b/source/blender/editors/space_buttons/CMakeLists.txt @@ -23,10 +23,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -46,6 +48,8 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + if(WITH_FREESTYLE) add_definitions(-DWITH_FREESTYLE) endif() diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript index 61f9b6f496e..07fe17e302b 100644 --- a/source/blender/editors/space_buttons/SConscript +++ b/source/blender/editors/space_buttons/SConscript @@ -31,12 +31,14 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', '../../bmesh', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', @@ -44,7 +46,8 @@ incs = [ '../../windowmanager', ] incs = ' '.join(incs) -defs = [] + +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/space_clip/CMakeLists.txt b/source/blender/editors/space_clip/CMakeLists.txt index 7689aa28169..4659e612b41 100644 --- a/source/blender/editors/space_clip/CMakeLists.txt +++ b/source/blender/editors/space_clip/CMakeLists.txt @@ -27,11 +27,12 @@ set(INC ../../blenfont ../../blenlib ../../imbuf + ../../gpu ../../makesdna ../../makesrna ../../windowmanager - ../../gpu ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -56,6 +57,8 @@ set(SRC clip_intern.h ) +add_definitions(${GL_DEFINITIONS}) + if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() diff --git a/source/blender/editors/space_clip/SConscript b/source/blender/editors/space_clip/SConscript index d4483eda6e3..8fec4ebf0fa 100644 --- a/source/blender/editors/space_clip/SConscript +++ b/source/blender/editors/space_clip/SConscript @@ -28,10 +28,13 @@ Import ('env') sources = env.Glob('*.c') -defs = [] + +defs = env['BF_GL_DEFINITIONS'] + incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', diff --git a/source/blender/editors/space_console/CMakeLists.txt b/source/blender/editors/space_console/CMakeLists.txt index 241a48c1e2d..ecfb1f0e0df 100644 --- a/source/blender/editors/space_console/CMakeLists.txt +++ b/source/blender/editors/space_console/CMakeLists.txt @@ -23,10 +23,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -45,4 +47,6 @@ if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_console "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_console/SConscript b/source/blender/editors/space_console/SConscript index 0395a33cd97..87d12fe34bd 100644 --- a/source/blender/editors/space_console/SConscript +++ b/source/blender/editors/space_console/SConscript @@ -28,16 +28,19 @@ Import ('env') sources = env.Glob('*.c') -defs = [] + +defs = env['BF_GL_DEFINITIONS'] incs = [ '../include', - '#/extern/glew/include', '#/intern/guardedalloc', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../../makesdna', '../../makesrna', '../../blenkernel', '../../blenlib', + '../../gpu', '../../windowmanager', '../../blenfont', ] diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt index 3b2db3ee7bc..fc007a659b4 100644 --- a/source/blender/editors/space_file/CMakeLists.txt +++ b/source/blender/editors/space_file/CMakeLists.txt @@ -25,11 +25,13 @@ set(INC ../../blenlib ../../blenloader ../../imbuf + ../../gpu ../../makesdna ../../makesrna ../../render/extern/include ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -86,6 +88,8 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + if(WITH_FREESTYLE) add_definitions(-DWITH_FREESTYLE) endif() diff --git a/source/blender/editors/space_file/SConscript b/source/blender/editors/space_file/SConscript index d42394454eb..85c3e073922 100644 --- a/source/blender/editors/space_file/SConscript +++ b/source/blender/editors/space_file/SConscript @@ -30,12 +30,14 @@ Import ('env') sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', '../../blenloader', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', @@ -44,7 +46,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_OPENJPEG']: defs.append('WITH_OPENJPEG') diff --git a/source/blender/editors/space_graph/CMakeLists.txt b/source/blender/editors/space_graph/CMakeLists.txt index d3fb87204fb..0a29810ff3d 100644 --- a/source/blender/editors/space_graph/CMakeLists.txt +++ b/source/blender/editors/space_graph/CMakeLists.txt @@ -23,10 +23,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -56,4 +58,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_graph "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_graph/SConscript b/source/blender/editors/space_graph/SConscript index 8ddeb0ccfe8..35e09749743 100644 --- a/source/blender/editors/space_graph/SConscript +++ b/source/blender/editors/space_graph/SConscript @@ -31,19 +31,21 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/audaspace/intern', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt index 62ac3c2d985..30bfc2fbdfd 100644 --- a/source/blender/editors/space_image/CMakeLists.txt +++ b/source/blender/editors/space_image/CMakeLists.txt @@ -23,14 +23,15 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib - ../../imbuf ../../bmesh + ../../imbuf + ../../gpu ../../makesdna ../../makesrna ../../render/extern/include ../../windowmanager ../../../../intern/guardedalloc - ../../gpu + ../../../../intern/glew-mx ) set(INC_SYS @@ -71,4 +72,6 @@ if(WITH_IMAGE_CINEON) add_definitions(-DWITH_CINEON) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_image "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript index d878a726b55..e983db431b4 100644 --- a/source/blender/editors/space_image/SConscript +++ b/source/blender/editors/space_image/SConscript @@ -31,12 +31,14 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', '../../bmesh', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', @@ -46,7 +48,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/space_info/CMakeLists.txt b/source/blender/editors/space_info/CMakeLists.txt index 94b40a9f40a..46ea251de03 100644 --- a/source/blender/editors/space_info/CMakeLists.txt +++ b/source/blender/editors/space_info/CMakeLists.txt @@ -26,10 +26,12 @@ set(INC ../../blenloader ../../imbuf ../../bmesh + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -52,4 +54,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_info "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_info/SConscript b/source/blender/editors/space_info/SConscript index 2a1419984c6..378940805da 100644 --- a/source/blender/editors/space_info/SConscript +++ b/source/blender/editors/space_info/SConscript @@ -31,13 +31,15 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', '../../blenloader', '../../bmesh', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', @@ -45,7 +47,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/space_logic/CMakeLists.txt b/source/blender/editors/space_logic/CMakeLists.txt index af2e8476511..19525c87923 100644 --- a/source/blender/editors/space_logic/CMakeLists.txt +++ b/source/blender/editors/space_logic/CMakeLists.txt @@ -24,10 +24,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -47,6 +49,8 @@ if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() +add_definitions(${GL_DEFINITIONS}) + if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() diff --git a/source/blender/editors/space_logic/SConscript b/source/blender/editors/space_logic/SConscript index ae8e929a684..067073fab22 100644 --- a/source/blender/editors/space_logic/SConscript +++ b/source/blender/editors/space_logic/SConscript @@ -31,12 +31,14 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../interface', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', @@ -44,7 +46,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/editors/space_nla/CMakeLists.txt b/source/blender/editors/space_nla/CMakeLists.txt index a74fc3191b7..ab0dfa30121 100644 --- a/source/blender/editors/space_nla/CMakeLists.txt +++ b/source/blender/editors/space_nla/CMakeLists.txt @@ -23,10 +23,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -49,4 +51,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_nla "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_nla/SConscript b/source/blender/editors/space_nla/SConscript index a00337e0b58..9e743d918b9 100644 --- a/source/blender/editors/space_nla/SConscript +++ b/source/blender/editors/space_nla/SConscript @@ -31,18 +31,20 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../makesdna', '../../makesrna', '../../windowmanager', ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/space_node/CMakeLists.txt b/source/blender/editors/space_node/CMakeLists.txt index 6b0460ce5cd..34887f8388d 100644 --- a/source/blender/editors/space_node/CMakeLists.txt +++ b/source/blender/editors/space_node/CMakeLists.txt @@ -32,6 +32,7 @@ set(INC ../../windowmanager ../../compositor ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -64,4 +65,6 @@ if(WITH_COMPOSITOR) add_definitions(-DWITH_COMPOSITOR) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_node "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_node/SConscript b/source/blender/editors/space_node/SConscript index 94756b96035..435a78f1b7e 100644 --- a/source/blender/editors/space_node/SConscript +++ b/source/blender/editors/space_node/SConscript @@ -31,7 +31,8 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', @@ -47,7 +48,8 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] + cf = [] if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): #cf.append('/WX') diff --git a/source/blender/editors/space_outliner/CMakeLists.txt b/source/blender/editors/space_outliner/CMakeLists.txt index 4db47b75502..b716f0671bd 100644 --- a/source/blender/editors/space_outliner/CMakeLists.txt +++ b/source/blender/editors/space_outliner/CMakeLists.txt @@ -24,10 +24,12 @@ set(INC ../../blenlib ../../blenfont ../../imbuf + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -50,4 +52,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_outliner "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_outliner/SConscript b/source/blender/editors/space_outliner/SConscript index db8041f0235..cc02c9555a9 100644 --- a/source/blender/editors/space_outliner/SConscript +++ b/source/blender/editors/space_outliner/SConscript @@ -28,15 +28,18 @@ Import ('env') sources = env.Glob('*.c') -defs = [] + +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', diff --git a/source/blender/editors/space_script/CMakeLists.txt b/source/blender/editors/space_script/CMakeLists.txt index 26c4183f7df..2eb31576c57 100644 --- a/source/blender/editors/space_script/CMakeLists.txt +++ b/source/blender/editors/space_script/CMakeLists.txt @@ -22,10 +22,12 @@ set(INC ../include ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -47,4 +49,6 @@ if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_script "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_script/SConscript b/source/blender/editors/space_script/SConscript index acb0bf9f20b..e749780a4aa 100644 --- a/source/blender/editors/space_script/SConscript +++ b/source/blender/editors/space_script/SConscript @@ -31,10 +31,12 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenkernel', '../../blenlib', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', @@ -42,7 +44,7 @@ incs = [ '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_PYTHON']: defs.append('WITH_PYTHON') diff --git a/source/blender/editors/space_sequencer/CMakeLists.txt b/source/blender/editors/space_sequencer/CMakeLists.txt index db5729a5762..4cf9c0c95c2 100644 --- a/source/blender/editors/space_sequencer/CMakeLists.txt +++ b/source/blender/editors/space_sequencer/CMakeLists.txt @@ -24,10 +24,12 @@ set(INC ../../blenkernel ../../blenlib ../../imbuf + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -60,4 +62,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_sequencer "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_sequencer/SConscript b/source/blender/editors/space_sequencer/SConscript index 5aae30244a7..954f8abff69 100644 --- a/source/blender/editors/space_sequencer/SConscript +++ b/source/blender/editors/space_sequencer/SConscript @@ -31,19 +31,21 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/audaspace/intern', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs.append(env['BF_PTHREADS_INC']) diff --git a/source/blender/editors/space_text/CMakeLists.txt b/source/blender/editors/space_text/CMakeLists.txt index bfeeb93372a..5367efbf84b 100644 --- a/source/blender/editors/space_text/CMakeLists.txt +++ b/source/blender/editors/space_text/CMakeLists.txt @@ -23,10 +23,12 @@ set(INC ../../blenfont ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -48,6 +50,8 @@ set(SRC text_intern.h ) +add_definitions(${GL_DEFINITIONS}) + if(WITH_PYTHON) list(APPEND INC ../../python diff --git a/source/blender/editors/space_text/SConscript b/source/blender/editors/space_text/SConscript index 3f617f95c58..8ee9bd745dd 100644 --- a/source/blender/editors/space_text/SConscript +++ b/source/blender/editors/space_text/SConscript @@ -28,14 +28,18 @@ Import ('env') sources = env.Glob('*.c') -defs = [] + +defs = env['BF_GL_DEFINITIONS'] + incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', + '../../gpu', '../../imbuf', '../../makesdna', '../../makesrna', diff --git a/source/blender/editors/space_time/CMakeLists.txt b/source/blender/editors/space_time/CMakeLists.txt index b42ae3ab725..90af405eaa8 100644 --- a/source/blender/editors/space_time/CMakeLists.txt +++ b/source/blender/editors/space_time/CMakeLists.txt @@ -22,10 +22,12 @@ set(INC ../include ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -39,4 +41,6 @@ set(SRC time_intern.h ) +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_space_time "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_time/SConscript b/source/blender/editors/space_time/SConscript index bf1b918f4f1..5a9e9a4cb42 100644 --- a/source/blender/editors/space_time/SConscript +++ b/source/blender/editors/space_time/SConscript @@ -31,15 +31,17 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenkernel', '../../blenlib', + '../../gpu', '../../makesdna', '../../makesrna', '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] env.BlenderLib('bf_editors_space_time', sources, incs, defs, libtype=['core'], priority=[65]) diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt index 97c328dbac2..320267a4a7c 100644 --- a/source/blender/editors/space_view3d/CMakeLists.txt +++ b/source/blender/editors/space_view3d/CMakeLists.txt @@ -31,6 +31,7 @@ set(INC ../../render/extern/include ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ../../../../intern/smoke/extern ) @@ -76,7 +77,7 @@ if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript index e6658ab3c49..a21da940906 100644 --- a/source/blender/editors/space_view3d/SConscript +++ b/source/blender/editors/space_view3d/SConscript @@ -28,11 +28,13 @@ Import ('env') sources = env.Glob('*.c') -defs = [ 'GLEW_STATIC' ] + +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/smoke/extern', '#/source/gameengine/BlenderRoutines', '../include', diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt index 3ad5d94efd6..0c360474b78 100644 --- a/source/blender/editors/transform/CMakeLists.txt +++ b/source/blender/editors/transform/CMakeLists.txt @@ -30,6 +30,7 @@ set(INC ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -54,4 +55,6 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_transform "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript index 4f47062e3a3..e249856b747 100644 --- a/source/blender/editors/transform/SConscript +++ b/source/blender/editors/transform/SConscript @@ -31,20 +31,21 @@ sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', '../../bmesh', + '../../gpu', '../../ikplugin', '../../makesdna', '../../makesrna', - '../../gpu', '../../windowmanager', ] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index 4400870f1b8..f4189a18da4 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -24,10 +24,12 @@ set(INC ../../blenkernel ../../blenlib ../../bmesh + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -91,7 +93,7 @@ set(SRC ../include/UI_view2d.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript index 0876fe48c91..d695a848f4e 100644 --- a/source/blender/editors/util/SConscript +++ b/source/blender/editors/util/SConscript @@ -28,16 +28,19 @@ Import ('env') sources = env.Glob('*.c') -defs = [ 'GLEW_STATIC' ] + +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../include', '../../blenfont', '../../blenkernel', '../../blenlib', '../../bmesh', + '../../gpu', '../../makesdna', '../../makesrna', '../../windowmanager', diff --git a/source/blender/editors/uvedit/CMakeLists.txt b/source/blender/editors/uvedit/CMakeLists.txt index 45edbde7482..74ba1672485 100644 --- a/source/blender/editors/uvedit/CMakeLists.txt +++ b/source/blender/editors/uvedit/CMakeLists.txt @@ -24,10 +24,12 @@ set(INC ../../blenlib ../../blenfont ../../bmesh + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -57,4 +59,6 @@ if(WITH_OPENNL) ) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_editor_uvedit "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/uvedit/SConscript b/source/blender/editors/uvedit/SConscript index 413503191cd..7153d25188b 100644 --- a/source/blender/editors/uvedit/SConscript +++ b/source/blender/editors/uvedit/SConscript @@ -27,13 +27,14 @@ Import ('env') -defs = [] +defs = env['BF_GL_DEFINITIONS'] sources = env.Glob('*.c') incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/opennl/extern', '../include', '../../blenfont', diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 13e46bc7de8..63eea9486ed 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -36,6 +36,7 @@ set(INC ../nodes ../nodes/intern + ../../../intern/glew-mx ../../../intern/guardedalloc ../../../intern/smoke/extern ) @@ -49,6 +50,7 @@ set(SRC intern/gpu_codegen.c intern/gpu_draw.c intern/gpu_extensions.c + intern/gpu_init_exit.c intern/gpu_material.c intern/gpu_simple_shader.c intern/gpu_select.c @@ -56,10 +58,13 @@ set(SRC GPU_buffers.h GPU_draw.h GPU_extensions.h + GPU_glew.h + GPU_init_exit.h GPU_material.h GPU_simple_shader.h GPU_select.h intern/gpu_codegen.h + intern/gpu_extensions_private.h ) data_to_c_simple(shaders/gpu_shader_material.glsl SRC) @@ -79,7 +84,7 @@ if(WITH_MOD_SMOKE) add_definitions(-DWITH_SMOKE) endif() -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_IMAGE_DDS) add_definitions(-DWITH_DDS) diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 04c4119df6e..3daf8585539 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -55,8 +55,6 @@ typedef struct GPUShader GPUShader; /* GPU extensions support */ void GPU_extensions_disable(void); -void GPU_extensions_init(void); /* call this before running any of the functions below */ -void GPU_extensions_exit(void); int GPU_print_error(const char *str); int GPU_glsl_support(void); diff --git a/source/blender/gpu/GPU_glew.h b/source/blender/gpu/GPU_glew.h new file mode 100644 index 00000000000..94217863fd6 --- /dev/null +++ b/source/blender/gpu/GPU_glew.h @@ -0,0 +1,37 @@ +/* + * ***** 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2012 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Jason Wilkins. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file source/blender/gpu/GPU_glew.h + * \ingroup gpu + */ + +#ifndef __GPU_GLEW_H__ +#define __GPU_GLEW_H__ + +#include "glew-mx.h" + +#endif /* __GPU_GLEW_H__ */ diff --git a/source/blender/gpu/GPU_init_exit.h b/source/blender/gpu/GPU_init_exit.h new file mode 100644 index 00000000000..e89c970b7d9 --- /dev/null +++ b/source/blender/gpu/GPU_init_exit.h @@ -0,0 +1,46 @@ +/* + * ***** 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2013 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Jason Wilkins. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/gpu/GPU_init_exit.h + * \ingroup gpu + */ + +#ifndef __GPU_INIT_EXIT_H__ +#define __GPU_INIT_EXIT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void GPU_init(void); +void GPU_exit(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __GPU_INIT_EXIT_H__ */ diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 8d44ad87916..a111401343e 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -34,6 +34,8 @@ #include "DNA_listBase.h" +#include "BLI_sys_types.h" /* for bool */ + #ifdef __cplusplus extern "C" { #endif diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript index e9320f08eff..f11ecafc986 100644 --- a/source/blender/gpu/SConscript +++ b/source/blender/gpu/SConscript @@ -30,13 +30,14 @@ Import ('env') sources = env.Glob('intern/*.c') sources += env.Glob('shaders/*.c') -defs = [ 'GLEW_STATIC' ] +defs = env['BF_GL_DEFINITIONS'] incs = [ '.', + '#/intern/glew-mx', '#/intern/guardedalloc', + env['BF_GLEW_INC'], '#/intern/smoke/extern', - '#/extern/glew/include', '../blenkernel', '../blenlib', '../bmesh', @@ -46,7 +47,6 @@ incs = [ '../makesrna', '../nodes', '../nodes/intern', - env['BF_OPENGL_INC'], ] if env['WITH_BF_GAMEENGINE']: diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 5d2c9cd3a90..b5a576b509c 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -36,7 +36,7 @@ #include <stddef.h> #include <string.h> -#include "GL/glew.h" +#include "GPU_glew.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 6b46db89a93..322d37055db 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -31,7 +31,7 @@ * Convert material node-trees to GLSL. */ -#include "GL/glew.h" +#include "GPU_glew.h" #include "MEM_guardedalloc.h" @@ -242,12 +242,12 @@ GPUFunction *GPU_lookup_function(const char *name) return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, (void *)name); } -void GPU_codegen_init(void) +void gpu_codegen_init(void) { GPU_code_generate_glsl_lib(); } -void GPU_codegen_exit(void) +void gpu_codegen_exit(void) { extern Material defmaterial; // render module abuse... diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index b6db923e5c2..69213925931 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -35,7 +35,7 @@ #include "DNA_listBase.h" #include "GPU_material.h" -#include "GL/glew.h" +#include "GPU_glew.h" struct ListBase; struct GPUShader; @@ -106,7 +106,7 @@ struct GPUNodeLink { int type; int users; - GPUTexture *dynamictex; + struct GPUTexture *dynamictex; GPUBuiltin builtin; GPUOpenGLBuiltin oglbuiltin; @@ -146,7 +146,7 @@ typedef struct GPUInput { float *dynamicvec; /* vector data in case it is dynamic */ int dynamictype; /* origin of the dynamic uniform (GPUDynamicType) */ void *dynamicdata; /* data source of the dynamic uniform */ - GPUTexture *tex; /* input texture, only set at runtime */ + struct GPUTexture *tex; /* input texture, only set at runtime */ int shaderloc; /* id from opengl */ char shadername[32]; /* name in shader */ @@ -185,8 +185,8 @@ void GPU_pass_unbind(GPUPass *pass); void GPU_pass_free(GPUPass *pass); -void GPU_codegen_init(void); -void GPU_codegen_exit(void); +void gpu_codegen_init(void); +void gpu_codegen_exit(void); /* Material calls */ diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 7295f0259c5..a4435a7d276 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -38,7 +38,7 @@ #include <string.h> -#include "GL/glew.h" +#include "GPU_glew.h" #include "BLI_blenlib.h" #include "BLI_linklist.h" @@ -1878,6 +1878,37 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[4][ return count; } +static void gpu_multisample(bool enable) +{ + if (GLEW_VERSION_1_3 || GLEW_ARB_multisample) { +#ifdef __linux__ + /* changing multisample enablement from the default (enabled) causes problems on some + * systems (NVIDIA/Linux) when the pixel format doesn't have a multisample buffer */ + bool toggle_ok = true; + + if (GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_UNIX, GPU_DRIVER_ANY)) { + int samples = 0; + glGetIntegerv(GL_SAMPLES, &samples); + + if (samples == 0) + toggle_ok = false; + } + + if (toggle_ok) { + if (enable) + glEnable(GL_MULTISAMPLE); + else + glDisable(GL_MULTISAMPLE); + } +#else + if (enable) + glEnable(GL_MULTISAMPLE); + else + glDisable(GL_MULTISAMPLE); +#endif + } +} + /* Default OpenGL State */ void GPU_state_init(void) @@ -1950,9 +1981,7 @@ void GPU_state_init(void) glCullFace(GL_BACK); glDisable(GL_CULL_FACE); - /* calling this makes drawing very slow when AA is not set up in ghost - * on Linux/NVIDIA. */ - // glDisable(GL_MULTISAMPLE); + gpu_multisample(false); } #ifdef DEBUG diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 7fabb2feb51..04f8e68431a 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -33,7 +33,7 @@ */ -#include "GL/glew.h" +#include "GPU_glew.h" #include "DNA_image_types.h" @@ -48,7 +48,9 @@ #include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_simple_shader.h" -#include "gpu_codegen.h" + +#include "intern/gpu_codegen.h" +#include "intern/gpu_extensions_private.h" #include <stdlib.h> #include <stdio.h> @@ -110,8 +112,6 @@ int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver) /* GPU Extensions */ -static int gpu_extensions_init = 0; - void GPU_extensions_disable(void) { GG.extdisabled = 1; @@ -122,18 +122,11 @@ int GPU_max_texture_size(void) return GG.maxtexsize; } -void GPU_extensions_init(void) +void gpu_extensions_init(void) { GLint r, g, b; const char *vendor, *renderer; - /* can't avoid calling this multiple times, see wm_window_add_ghostwindow */ - if (gpu_extensions_init) return; - gpu_extensions_init= 1; - - glewInit(); - GPU_codegen_init(); - /* glewIsSupported("GL_VERSION_2_0") */ if (GLEW_ARB_multitexture) @@ -233,10 +226,8 @@ void GPU_extensions_init(void) GPU_simple_shaders_init(); } -void GPU_extensions_exit(void) +void gpu_extensions_exit(void) { - gpu_extensions_init = 0; - GPU_codegen_exit(); GPU_simple_shaders_exit(); GPU_invalid_tex_free(); } diff --git a/source/blender/gpu/intern/gpu_extensions_private.h b/source/blender/gpu/intern/gpu_extensions_private.h new file mode 100644 index 00000000000..a4124b8fa3d --- /dev/null +++ b/source/blender/gpu/intern/gpu_extensions_private.h @@ -0,0 +1,32 @@ +/* + * ***** 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file gpu_extensions_private.h + * \ingroup gpu + */ + +#ifndef __GPU_EXTENSIONS_PRIVATE_H__ +#define __GPU_EXTENSIONS_PRIVATE_H__ + +/* call this before running any of the functions below */ +void gpu_extensions_init(void); +void gpu_extensions_exit(void); + +#endif /* __GPU_EXTENSIONS_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_init_exit.c b/source/blender/gpu/intern/gpu_init_exit.c new file mode 100644 index 00000000000..912774cd345 --- /dev/null +++ b/source/blender/gpu/intern/gpu_init_exit.c @@ -0,0 +1,68 @@ +/* + * ***** 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2013 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Jason Wilkins + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file source/blender/gpu/intern/gpu_init_exit.c + * \ingroup gpu + */ + +#include "BLI_sys_types.h" +#include "GPU_init_exit.h" /* interface */ +#include "GPU_extensions.h" /* library */ + +#include "intern/gpu_codegen.h" +#include "intern/gpu_extensions_private.h" + +/** + * although the order of initialization and shutdown should not matter + * (except for the extensions), I chose alphabetical and reverse alphabetical order + */ + +static bool initialized = false; + +void GPU_init(void) +{ + /* can't avoid calling this multiple times, see wm_window_add_ghostwindow */ + if (initialized) + return; + + initialized = true; + + gpu_extensions_init(); /* must come first */ + + gpu_codegen_init(); +} + + + +void GPU_exit(void) +{ + gpu_codegen_exit(); + + gpu_extensions_exit(); /* must come last */ + + initialized = false; +} diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 75fed46f62a..f91fd7a8c1e 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -35,8 +35,6 @@ #include <math.h> #include <string.h> -#include "GL/glew.h" - #include "MEM_guardedalloc.h" #include "DNA_lamp_types.h" diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c index 1d448231dda..afd6af9efae 100644 --- a/source/blender/gpu/intern/gpu_select.c +++ b/source/blender/gpu/intern/gpu_select.c @@ -31,15 +31,14 @@ */ #include "GPU_select.h" #include "GPU_extensions.h" - +#include "GPU_glew.h" + #include "BLI_utildefines.h" #include "MEM_guardedalloc.h" #include "DNA_userdef_types.h" -#include <GL/glew.h> - /* Ad hoc number of queries to allocate to skip doing many glGenQueries */ #define ALLOC_QUERIES 200 diff --git a/source/blender/gpu/intern/gpu_simple_shader.c b/source/blender/gpu/intern/gpu_simple_shader.c index 0cb712d220f..c0d7ebd4abb 100644 --- a/source/blender/gpu/intern/gpu_simple_shader.c +++ b/source/blender/gpu/intern/gpu_simple_shader.c @@ -42,7 +42,7 @@ * - Optimize for case where no texture matrix is used. */ -#include "GL/glew.h" +#include "GPU_glew.h" #include "BLI_math.h" #include "BLI_utildefines.h" diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 17bbfb1cc84..4e7a564e9d4 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -38,7 +38,8 @@ incs = [ '#/intern/guardedalloc', '#/intern/atomic', '#/intern/memutil', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/audaspace/intern', '#/intern/cycles/blender', '#/intern/smoke/extern', @@ -57,7 +58,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_SMOKE']: defs.append('WITH_SMOKE') diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index c5f62439b9e..9a53ebcec03 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -293,6 +293,7 @@ blender_include_dirs( ../../../../intern/audaspace/intern ../../../../intern/cycles/blender ../../../../intern/guardedalloc + ../../../../intern/glew-mx ../../../../intern/atomic ../../../../intern/memutil ../../../../intern/smoke/extern @@ -328,4 +329,6 @@ set(SRC rna_mesh_utils.h ) +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 9fda79feb74..d1eab5ca9db 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -53,11 +53,12 @@ makesrna_tool = env.Clone() rna = env.Clone() makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" ') -defs = [] +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/audaspace/intern', '#/intern/cycles/blender', '#/intern/smoke/extern', @@ -66,6 +67,7 @@ incs = [ '../../blenlib', '../../bmesh', '../../editors/include', + '../../gpu', '../../ikplugin', '../../imbuf', '../../makesdna', diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index 71c84fd1e8a..06e9f8f5b67 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -40,7 +40,6 @@ set(INC set(INC_SYS ${ZLIB_INCLUDE_DIRS} - ${GLEW_INCLUDE_PATH} ) set(SRC diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript index c112f525398..c15a562abc0 100644 --- a/source/blender/modifiers/SConscript +++ b/source/blender/modifiers/SConscript @@ -34,7 +34,6 @@ incs = [ './intern', '#/intern/guardedalloc', '#/intern/elbeem/extern', - '#/extern/glew/include', '#/intern/opennl/extern', '../render/extern/include', '../bmesh', diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 2293415aef0..9eb6c1674a3 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -38,6 +38,7 @@ set(INC ../makesrna ../render/extern/include ../../../intern/guardedalloc + ../../../intern/glew-mx ) set(INC_SYS @@ -279,6 +280,8 @@ if(WITH_COMPOSITOR) add_definitions(-DWITH_COMPOSITOR) endif() +add_definitions(${GL_DEFINITIONS}) + if(WITH_FREESTYLE) add_definitions(-DWITH_FREESTYLE) endif() diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript index becf6e79d44..aed846355c3 100644 --- a/source/blender/nodes/SConscript +++ b/source/blender/nodes/SConscript @@ -39,7 +39,8 @@ incs = [ './shader', './texture', '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../blenfont', '../blenkernel', '../blenlib', @@ -48,12 +49,11 @@ incs = [ '../makesdna', '../makesrna', '../render/extern/include', - env['BF_OPENGL_INC'], env['BF_ZLIB_INC'], ] incs = ' '.join(incs) -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index a5b52a3dd63..9988e0981aa 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -33,7 +33,8 @@ incs = [ '.', '#/intern/guardedalloc', '#/intern/memutil', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/audaspace/intern', '#/intern/cycles/blender', '../blenfont', @@ -62,7 +63,7 @@ sources = env.Glob('bmesh/*.c') env.BlenderLib( libname = 'bf_python_bmesh', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [362,165]) # generic -defs = ['GLEW_STATIC'] +defs = env['BF_GL_DEFINITIONS'] if is_debug: defs.append('_DEBUG') @@ -79,7 +80,7 @@ env.BlenderLib( libname = 'bf_python_mathutils', sources = Split(sources), inclu # bpy -defs = [] +defs = env['BF_GL_DEFINITIONS'] if is_debug: defs.append('_DEBUG') diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt index aec2faa89e6..155247a4249 100644 --- a/source/blender/python/generic/CMakeLists.txt +++ b/source/blender/python/generic/CMakeLists.txt @@ -22,8 +22,10 @@ set(INC . ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS @@ -46,6 +48,6 @@ set(SRC py_capi_utils.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) blender_add_lib(bf_python_ext "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index b8dcf9d8491..c599ce26f6c 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -33,7 +33,7 @@ #include <Python.h> #include "bgl.h" /*This must come first */ -#include <GL/glew.h> +#include "GPU_glew.h" #include "MEM_guardedalloc.h" #include "BLI_utildefines.h" diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index 70b4df7d6fe..a75db23d20b 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -260,5 +260,6 @@ if(WITH_PLAYER) add_definitions(-DWITH_PLAYER) endif() +add_definitions(${GL_DEFINITIONS}) blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index 5f993297840..088bddc8a76 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -40,12 +40,12 @@ set(INC ../../gameengine/BlenderRoutines ../../../intern/ghost ../../../intern/guardedalloc + ../../../intern/glew-mx ../../../intern/memutil ) set(INC_SYS ${ZLIB_INCLUDE_DIRS} - ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_PATH} ) @@ -78,7 +78,7 @@ set(SRC wm_window.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) @@ -107,6 +107,8 @@ endif() if(WITH_HEADLESS) add_definitions(-DWITH_HEADLESS) +elseif(WITH_X11) + add_definitions(-DWITH_X11) endif() if(WITH_PYTHON) diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript index 00d363e1539..b93192d5067 100644 --- a/source/blender/windowmanager/SConscript +++ b/source/blender/windowmanager/SConscript @@ -36,7 +36,8 @@ incs = [ '#/intern/guardedalloc', '#/intern/memutil', '#/source/gameengine/BlenderRoutines', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '../blenfont', '../blenkernel', '../blenlib', @@ -54,7 +55,7 @@ incs = [ ] incs = ' '.join(incs) -defs = [ 'GLEW_STATIC' ] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_PYTHON']: defs.append('WITH_PYTHON') @@ -78,4 +79,7 @@ if env['WITH_BF_COMPOSITOR']: if env['WITH_BF_PYTHON_SECURITY']: defs.append("WITH_PYTHON_SECURITY") +if env['OURPLATFORM'] in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'aix4', 'aix5'): + defs.append("WITH_X11") + env.BlenderLib ( 'bf_windowmanager', sources, Split(incs), defines=defs, libtype=['core'], priority=[5] ) diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 2f20e8c234f..7440570f4a0 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -32,7 +32,6 @@ #include <stdlib.h> #include <string.h> -#include <GL/glew.h> #include "DNA_listBase.h" #include "DNA_screen_types.h" @@ -57,6 +56,7 @@ #include "GPU_draw.h" #include "GPU_extensions.h" +#include "GPU_glew.h" #include "RE_engine.h" diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index b1f693502f6..20f5f8d3e3e 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -110,6 +110,7 @@ #include "GPU_buffers.h" #include "GPU_extensions.h" #include "GPU_draw.h" +#include "GPU_init_exit.h" #include "BKE_depsgraph.h" #include "BKE_sound.h" @@ -195,7 +196,8 @@ void WM_init(bContext *C, int argc, const char **argv) wm_init_reports(C); /* reports cant be initialized before the wm */ if (!G.background) { - GPU_extensions_init(); + GPU_init(); + GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); GPU_set_anisotropic(U.anisotropic_filter); GPU_set_gpu_mipmapping(U.use_gpu_mipmap); @@ -502,7 +504,8 @@ void WM_exit_ext(bContext *C, const bool do_python) if (!G.background) { GPU_global_buffer_pool_free(); GPU_free_unused_buffers(); - GPU_extensions_exit(); + + GPU_exit(); } BKE_reset_undo(); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index ec806fb7c61..46a20d3bf88 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -55,7 +55,6 @@ #include "BKE_global.h" #include "BKE_main.h" -#include "BIF_gl.h" #include "RNA_access.h" @@ -74,6 +73,8 @@ #include "GPU_draw.h" #include "GPU_extensions.h" +#include "GPU_init_exit.h" +#include "GPU_glew.h" #include "UI_interface.h" @@ -319,8 +320,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) /* nothing to do for 'temp' windows, * because WM_window_open_temp always sets window title */ } - else { - + else if (win->ghostwin) { /* this is set to 1 if you don't have startup.blend open */ if (G.save_over && G.main->name[0]) { char str[sizeof(G.main->name) + 24]; @@ -353,7 +353,7 @@ float wm_window_pixelsize(wmWindow *win) } /* belongs to below */ -static void wm_window_add_ghostwindow(const char *title, wmWindow *win) +static void wm_window_add_ghostwindow(wmWindowManager *wm, const char *title, wmWindow *win) { GHOST_WindowHandle ghostwin; static int multisamples = -1; @@ -377,8 +377,11 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win) if (ghostwin) { GHOST_RectangleHandle bounds; + /* the new window has already been made drawable upon creation */ + wm->windrawable = win; + /* needed so we can detect the graphics card below */ - GPU_extensions_init(); + GPU_init(); win->ghostwin = ghostwin; GHOST_SetWindowUserData(ghostwin, win); /* pointer back */ @@ -444,8 +447,7 @@ void wm_window_add_ghostwindows(wmWindowManager *wm) wm_init_state.start_x = 0; wm_init_state.start_y = 0; - -#if !defined(__APPLE__) && !defined(WIN32) /* X11 */ +#ifdef WITH_X11 /* X11 */ /* X11, start maximized but use default sane size */ wm_init_state.size_x = min_ii(wm_init_state.size_x, WM_WIN_INIT_SIZE_X); wm_init_state.size_y = min_ii(wm_init_state.size_y, WM_WIN_INIT_SIZE_Y); @@ -474,7 +476,7 @@ void wm_window_add_ghostwindows(wmWindowManager *wm) wm_init_state.override_flag &= ~WIN_OVERRIDE_WINSTATE; } - wm_window_add_ghostwindow("Blender", win); + wm_window_add_ghostwindow(wm, "Blender", win); } /* happens after fileread */ if (win->eventstate == NULL) @@ -1426,9 +1428,9 @@ void wm_window_set_swap_interval (wmWindow *win, int interval) GHOST_SetSwapInterval(win->ghostwin, interval); } -int wm_window_get_swap_interval (wmWindow *win) +bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut) { - return GHOST_GetSwapInterval(win->ghostwin); + return GHOST_GetSwapInterval(win->ghostwin, intervalOut); } diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index bf96e020a48..9c9c79d2f54 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -58,8 +58,8 @@ void wm_window_lower (wmWindow *win); void wm_window_set_size (wmWindow *win, int width, int height); void wm_window_get_position (wmWindow *win, int *posx_r, int *posy_r); void wm_window_swap_buffers (wmWindow *win); -void wm_window_set_swap_interval (wmWindow *win, int interval); -int wm_window_get_swap_interval (wmWindow *win); +void wm_window_set_swap_interval(wmWindow *win, int interval); +bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut); float wm_window_pixelsize(wmWindow *win); diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 188fb01d23d..ce20371d91b 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -162,7 +162,7 @@ endif() endif() if(NOT WITH_SYSTEM_GLEW) - list(APPEND BLENDER_SORTED_LIBS extern_glew) + list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES}) endif() if(WITH_LZMA) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 35cbff33342..20c2448eed3 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -27,6 +27,7 @@ setup_libdirs() blender_include_dirs( ../../intern/guardedalloc + ../../intern/glew-mx ../blender/blenlib ../blender/blenkernel ../blender/blenloader @@ -39,6 +40,9 @@ blender_include_dirs( ../blender/windowmanager ) +add_definitions(${GL_DEFINITIONS}) +blender_include_dirs(${GLEW_INCLUDE_PATH}) + if(WIN32) blender_include_dirs(../../intern/utfconv) endif() @@ -676,6 +680,18 @@ elseif(WIN32) unset(_PYTHON_VERSION_NO_DOTS) endif() + # EGL Runtime Components + if(WITH_GL_EGL) + if(WIN32) + install(FILES "${OPENGLES_DLL}" DESTINATION ${TARGETDIR}) + install(FILES "${OPENGLES_EGL_DLL}" DESTINATION ${TARGETDIR}) + + if(WITH_GL_ANGLE) + install(FILES "${D3DCOMPILER_DLL}" DESTINATION ${TARGETDIR}) + endif() + endif() + endif() + if(MSVC) install( FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll diff --git a/source/creator/creator.c b/source/creator/creator.c index 458afb2d131..12ae5c502e4 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1609,21 +1609,6 @@ int main( #endif setCallbacks(); -#if defined(__APPLE__) && !defined(WITH_PYTHON_MODULE) - /* patch to ignore argument finder gives us (pid?) */ - if (argc == 2 && strncmp(argv[1], "-psn_", 5) == 0) { - extern int GHOST_HACK_getFirstFile(char buf[]); - static char firstfilebuf[512]; - - argc = 1; - - if (GHOST_HACK_getFirstFile(firstfilebuf)) { - argc = 2; - argv[1] = firstfilebuf; - } - } - -#endif #ifdef __FreeBSD__ fpsetmask(0); diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index c652532895f..2a7e631637e 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -40,7 +40,7 @@ # pragma warning (disable:4786) #endif -#include "GL/glew.h" +#include "glew-mx.h" #include "KX_BlenderCanvas.h" #include "KX_BlenderKeyboardDevice.h" @@ -299,7 +299,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); // Setup vsync - int previous_vsync = canvas->GetSwapInterval(); + int previous_vsync = 0; + canvas->GetSwapInterval(previous_vsync); if (startscene->gm.vsync == VSYNC_ADAPTIVE) canvas->SetSwapInterval(-1); else diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index 73dbe005518..1a2809cc8ab 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -24,6 +24,7 @@ set(INC ../../blender/makesrna ../../blender/windowmanager ../../../intern/container + ../../../intern/glew-mx ../../../intern/guardedalloc ../../../intern/string ) @@ -52,7 +53,7 @@ set(SRC KX_BlenderSystem.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_AUDASPACE) list(APPEND INC diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index b3e0b4c3ea6..31f3b1b2047 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -29,7 +29,7 @@ * \ingroup blroutines */ -#include <GL/glew.h> +#include "glew-mx.h" #include "MEM_guardedalloc.h" @@ -91,9 +91,9 @@ void KX_BlenderCanvas::SetSwapInterval(int interval) wm_window_set_swap_interval(m_win, interval); } -int KX_BlenderCanvas::GetSwapInterval() +bool KX_BlenderCanvas::GetSwapInterval(int &intervalOut) { - return wm_window_get_swap_interval(m_win); + return wm_window_get_swap_interval(m_win, &intervalOut); } void KX_BlenderCanvas::ResizeWindow(int width, int height) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index 9ad80cb1737..917e0136cb1 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -82,8 +82,9 @@ public: int interval ); - int + bool GetSwapInterval( + int &intervalOut ); void diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index 62d657189c5..def0bc32697 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -29,9 +29,7 @@ Import ('env') sources = env.Glob('*.cpp') -defs = [ - 'GLEW_STATIC', - ] +defs = env['BF_GL_DEFINITIONS'] incs = [ '.', @@ -39,7 +37,8 @@ incs = [ '#intern/guardedalloc', '#intern/string', '#source/blender', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#intern/audaspace/intern', '#intern/ghost/include', '#intern/moto/include', diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt index fd73b4efb53..e6c980de566 100644 --- a/source/gameengine/GamePlayer/common/CMakeLists.txt +++ b/source/gameengine/GamePlayer/common/CMakeLists.txt @@ -47,6 +47,7 @@ set(INC ../../../blender/makesdna ../../../../intern/container ../../../../intern/ghost + ../../../../intern/glew-mx ../../../../intern/guardedalloc ../../../../intern/string ) @@ -69,6 +70,6 @@ set(SRC GPC_MouseDevice.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) blender_add_lib_nolist(ge_player_common "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h index bd50066a212..338f9647b3e 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.h +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h @@ -40,7 +40,7 @@ # include <windows.h> #endif /* WIN32 */ -#include "GL/glew.h" +#include "glew-mx.h" #include <map> diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index e30c2eb5859..b8fb9cbd2e2 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -64,12 +64,11 @@ incs = [ '#source/blender/misc', '#source/blender/blenloader', '#source/blender/gpu', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', ] -defs = [ - 'GLEW_STATIC', - ] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_PYTHON']: incs.extend(Split(env['BF_PYTHON_INC'])) diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index df752799c2c..8ab090eac02 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -48,6 +48,7 @@ set(INC ../../../blender/makesrna ../../../../intern/container ../../../../intern/ghost + ../../../../intern/glew-mx ../../../../intern/guardedalloc ../../../../intern/string ../../../../intern/memutil @@ -73,7 +74,7 @@ set(SRC GPG_System.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_CODEC_FFMPEG) add_definitions(-DWITH_FFMPEG) diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index b85d4b40ca8..d7a63c28da3 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -36,8 +36,9 @@ # include <windows.h> #endif -#include "GL/glew.h" +#include "glew-mx.h" #include "GPU_extensions.h" +#include "GPU_init_exit.h" #include "GPG_Application.h" #include "BL_BlenderDataConversion.h" @@ -545,7 +546,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) { if (!m_engineInitialized) { - GPU_extensions_init(); + GPU_init(); bgl::InitExtensions(true); // get and set the preferences @@ -867,7 +868,7 @@ void GPG_Application::exitEngine() m_canvas = 0; } - GPU_extensions_exit(); + GPU_exit(); #ifdef WITH_PYTHON // Call this after we're sure nothing needs Python anymore (e.g., destructors) diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp index 35c7c62a67d..556f85804ea 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp @@ -113,12 +113,12 @@ void GPG_Canvas::SetSwapInterval(int interval) m_window->setSwapInterval(interval); } -int GPG_Canvas::GetSwapInterval() +bool GPG_Canvas::GetSwapInterval(int& intervalOut) { if (m_window) - return m_window->getSwapInterval(); + return (bool)m_window->getSwapInterval(intervalOut); - return 0; + return false; } void GPG_Canvas::ResizeWindow(int width, int height) diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h index 6e1f86cac0e..337c2cedf55 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h @@ -56,7 +56,7 @@ public: virtual void SetMouseState(RAS_MouseState mousestate); virtual void SwapBuffers(); virtual void SetSwapInterval(int interval); - virtual int GetSwapInterval(); + virtual bool GetSwapInterval(int& intervalOut); virtual int GetMouseX(int x) { return x; } virtual int GetMouseY(int y) { return y; } diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index b6456b105c8..3bb5f17841d 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -79,8 +79,6 @@ extern "C" #include "IMB_imbuf.h" #include "IMB_moviecache.h" - int GHOST_HACK_getFirstFile(char buf[]); - // For BLF #include "BLF_api.h" #include "BLF_translation.h" @@ -294,12 +292,6 @@ static void get_filename(int argc, char **argv, char *filename) if (BLI_exists(argv[argc-1])) { BLI_strncpy(filename, argv[argc-1], FILE_MAX); } - if (::strncmp(argv[argc-1], "-psn_", 5)==0) { - static char firstfilebuf[512]; - if (GHOST_HACK_getFirstFile(firstfilebuf)) { - BLI_strncpy(filename, firstfilebuf, FILE_MAX); - } - } } srclen -= ::strlen("MacOS/blenderplayer"); @@ -811,14 +803,6 @@ int main(int argc, char** argv) if (scr_saver_mode != SCREEN_SAVER_MODE_CONFIGURATION) #endif { - - if (SYS_GetCommandLineInt(syshandle, "nomipmap", 0)) { - GPU_set_mipmap(0); - } - - GPU_set_anisotropic(U.anisotropic_filter); - GPU_set_gpu_mipmapping(U.use_gpu_mipmap); - // Create the system if (GHOST_ISystem::createSystem() == GHOST_kSuccess) { GHOST_ISystem* system = GHOST_ISystem::getSystem(); @@ -1041,6 +1025,13 @@ int main(int argc, char** argv) else app.startWindow(title, windowLeft, windowTop, windowWidth, windowHeight, stereoWindow, stereomode, aasamples); + + if (SYS_GetCommandLineInt(syshandle, "nomipmap", 0)) { + GPU_set_mipmap(0); + } + + GPU_set_anisotropic(U.anisotropic_filter); + GPU_set_gpu_mipmapping(U.use_gpu_mipmap); } } } diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index 3e8ab3d0dd7..d4c31889a5e 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -68,15 +68,14 @@ incs = [ '#source/blender/misc', '#source/blender/blenloader', '#source/blender/gpu', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', ] incs.append(env['BF_PTHREADS_INC']) incs.append(env['BF_BOOST_INC']) -defs = [ - 'GLEW_STATIC', - ] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_PYTHON']: incs += Split(env['BF_PYTHON_INC']) diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 872ac19351d..a59c3686a18 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -22,7 +22,7 @@ * \ingroup ketsji */ -#include "GL/glew.h" +#include "glew-mx.h" #include <iostream> #include "BL_Shader.h" diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index 1578c745b9f..1a78efb3c18 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -22,7 +22,7 @@ * \ingroup ketsji */ -#include "GL/glew.h" +#include "glew-mx.h" #include <iostream> #include <map> diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index 03d1524b310..44532e5d737 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -49,6 +49,7 @@ set(INC ../../blender/python/generic ../../blender/python/mathutils ../../../intern/container + ../../../intern/glew-mx ../../../intern/guardedalloc ../../../intern/string ) @@ -229,7 +230,7 @@ set(SRC ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) if(WITH_IMAGE_DDS) add_definitions(-DWITH_DDS) diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 9ebdfea6156..9f0b582045f 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -22,7 +22,7 @@ * \ingroup ketsji */ -#include "GL/glew.h" +#include "glew-mx.h" #include "KX_BlenderMaterial.h" #include "BL_Material.h" diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 4ab768e4240..e0761154ed2 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -31,7 +31,7 @@ */ -#include "GL/glew.h" +#include "glew-mx.h" #include "KX_Camera.h" #include "KX_Scene.h" #include "KX_PythonInit.h" diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index c7f7f586865..a77269c116d 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -41,7 +41,7 @@ #include "RAS_CameraData.h" #include "BLI_math.h" -#include "GL/glew.h" +#include "glew-mx.h" // constructor KX_Dome::KX_Dome ( diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index a7e798a3944..420565e62f6 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -38,7 +38,7 @@ #include "RAS_IRasterizer.h" #include "KX_KetsjiEngine.h" -#include "GL/glew.h" +#include "glew-mx.h" #include <vector> #include "MEM_guardedalloc.h" diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index da8a0c0844e..fefc64b4bad 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -30,7 +30,7 @@ * \ingroup ketsji */ -#include "GL/glew.h" +#include "glew-mx.h" #ifdef _MSC_VER # pragma warning (disable:4786) @@ -1396,7 +1396,9 @@ static PyObject *gPySetVsync(PyObject *, PyObject *args) static PyObject *gPyGetVsync(PyObject *) { - return PyLong_FromLong(gp_Canvas->GetSwapInterval()); + int interval = 0; + gp_Canvas->GetSwapInterval(interval); + return PyLong_FromLong(interval); } static PyObject *gPyShowFramerate(PyObject *, PyObject *args) diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index db5474cf2d7..8074a4064ff 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -30,7 +30,7 @@ import sys Import ('env') sources = env.Glob('*.cpp') -defs = [ 'GLEW_STATIC' ] +defs = env['BF_GL_DEFINITIONS'] incs = [ '.', @@ -38,7 +38,8 @@ incs = [ '#intern/guardedalloc', '#intern/string', '#source/blender', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#intern/audaspace/FX', '#intern/audaspace/intern', '#intern/moto/include', diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index fbaa7bb59ba..e52dc1ba052 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -40,6 +40,7 @@ set(INC ../../../blender/makesdna ../../../../intern/container ../../../../intern/guardedalloc + ../../../../intern/glew-mx ../../../../intern/string ) @@ -66,4 +67,6 @@ if(WITH_BULLET) add_definitions(-DWITH_BULLET) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(ge_phys_bullet "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 2a8249b9558..30287553a10 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -34,7 +34,8 @@ incs = [ '#intern/container', '#intern/guardedalloc', '#intern/string', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#intern/moto/include', '#source/blender/blenkernel', '#source/blender/blenlib', @@ -51,7 +52,7 @@ incs = ' '.join(incs) incs += ' ' + env['BF_BULLET_INC'] -defs = [] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index e254bf9b1c5..5bc3f22e327 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -32,6 +32,7 @@ set(INC ../../blender/blenlib ../../blender/blenkernel ../../../intern/container + ../../../intern/glew-mx ../../../intern/guardedalloc ../../../intern/string ) @@ -81,6 +82,6 @@ set(SRC RAS_OpenGLFilters/RAS_Sobel2DFilter.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) blender_add_lib(ge_rasterizer "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index abbe65738d4..908c5979249 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -43,7 +43,7 @@ #include "RAS_2DFilterManager.h" #include <iostream> -#include "GL/glew.h" +#include "glew-mx.h" #include <stdio.h> diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index 9e8a6e8ccf6..d90cbea286e 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -113,8 +113,9 @@ public: )=0; virtual - int + bool GetSwapInterval( + int& intervalOut )=0; virtual diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt index f0410ba891d..888a7114f50 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt @@ -39,6 +39,7 @@ set(INC ../../../blender/gpu ../../../blender/makesdna ../../../../intern/container + ../../../../intern/glew-mx ../../../../intern/string ) @@ -66,6 +67,6 @@ set(SRC RAS_StorageVBO.h ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) blender_add_lib(ge_oglrasterizer "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp index 32cc4ba9fea..bc22d68e218 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp @@ -32,7 +32,7 @@ #include <iostream> -#include "GL/glew.h" +#include "glew-mx.h" #include "RAS_GLExtensionManager.h" diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index e1dbd6f0a7f..b3da5e1f812 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -30,7 +30,7 @@ #include <windows.h> #endif // WIN32 -#include "GL/glew.h" +#include "glew-mx.h" #include "RAS_MaterialBucket.h" #include "RAS_TexVert.h" diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp index e1b7a2151c5..4ac1c9c4ebb 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp @@ -25,9 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include "glew-mx.h" + #include <stdio.h> -#include "GL/glew.h" #include "RAS_OpenGLLight.h" #include "RAS_OpenGLRasterizer.h" diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 0960fdaab4f..415ea87fb1b 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -35,7 +35,7 @@ #include "RAS_OpenGLRasterizer.h" -#include "GL/glew.h" +#include "glew-mx.h" #include "RAS_ICanvas.h" #include "RAS_Rect.h" diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp index c8975c245cb..e0613350b77 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp @@ -29,7 +29,7 @@ #include "RAS_MaterialBucket.h" #include "RAS_IPolygonMaterial.h" -#include "GL/glew.h" +#include "glew-mx.h" #include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_material.h" diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp index 006c07b0491..c2980a6c15f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp @@ -27,7 +27,7 @@ #include "RAS_StorageVA.h" -#include "GL/glew.h" +#include "glew-mx.h" RAS_StorageVA::RAS_StorageVA(int *texco_num, RAS_IRasterizer::TexCoGen *texco, int *attrib_num, RAS_IRasterizer::TexCoGen *attrib, int *attrib_layer) : m_drawingmode(RAS_IRasterizer::KX_TEXTURED), diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp index 6aa90fbd6ef..58f3d4c05da 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp @@ -28,7 +28,7 @@ #include "RAS_StorageVBO.h" #include "RAS_MeshObject.h" -#include "GL/glew.h" +#include "glew-mx.h" VBO::VBO(RAS_DisplayArray *data, unsigned int indices) { diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.h index 2fe0c32f399..f156722247c 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.h @@ -29,7 +29,7 @@ #define __KX_VERTEXBUFFEROBJECTSTORAGE #include <map> -#include "GL/glew.h" +#include "glew-mx.h" #include "RAS_IStorage.h" #include "RAS_IRasterizer.h" diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index 0a7417656c6..93905f733dc 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -3,14 +3,15 @@ Import ('env') sources = env.Glob('*.cpp') -defs = [ 'GLEW_STATIC' ] +defs = env['BF_GL_DEFINITIONS'] incs = [ '.', '#intern/container', '#intern/guardedalloc', '#intern/string', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#intern/moto/include', '#source/blender/blenkernel', '#source/blender/blenfont', diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index 5c68ce63a3b..c0d725ad957 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -36,15 +36,17 @@ incs = [ '#intern/moto/include', '#intern/container', '#source/gameengine/BlenderRoutines', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#source/gameengine/Expressions', '#source/gameengine/SceneGraph', '#source/blender/blenlib', '#source/blender/blenkernel', + '#source/blender/gpu', '#source/blender/makesdna', ] -defs = ['GLEW_STATIC'] +defs = env['BF_GL_DEFINITIONS'] if env['WITH_BF_PYTHON']: incs.extend(Split(env['BF_PYTHON_INC'])) diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt index 3ca3917cf6d..4be9a9abe5c 100644 --- a/source/gameengine/VideoTexture/CMakeLists.txt +++ b/source/gameengine/VideoTexture/CMakeLists.txt @@ -42,6 +42,7 @@ set(INC ../../blender/python/generic ../../../intern/container ../../../intern/ffmpeg + ../../../intern/glew-mx ../../../intern/guardedalloc ../../../intern/string ) @@ -51,7 +52,7 @@ set(INC_SYS ${GLEW_INCLUDE_PATH} ) -add_definitions(-DGLEW_STATIC) +add_definitions(${GL_DEFINITIONS}) set(SRC Exception.cpp diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index 4109981a98c..0d46160a11e 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -32,7 +32,7 @@ extern "C" { #include "bgl.h" } -#include "GL/glew.h" +#include "glew-mx.h" #include <vector> #include <string.h> diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 8c6dcf45d6f..617e7fd1d8e 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -36,7 +36,7 @@ #include <math.h> -#include "GL/glew.h" +#include "glew-mx.h" #include "KX_PythonInit.h" #include "DNA_scene_types.h" diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp index 789b6006f99..421f0df814b 100644 --- a/source/gameengine/VideoTexture/ImageViewport.cpp +++ b/source/gameengine/VideoTexture/ImageViewport.cpp @@ -33,7 +33,7 @@ #include "PyObjectPlus.h" #include <structmember.h> -#include "GL/glew.h" +#include "glew-mx.h" #include "KX_PythonInit.h" #include "RAS_ICanvas.h" diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index f7bf6bd93c1..b1b02db3ebc 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -37,7 +37,8 @@ incs = [ '#intern/ffmpeg', '#intern/guardedalloc', '#intern/string', - '#extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#intern/moto/include', '#source/blender/blenkernel', '#source/blender/blenlib', @@ -57,7 +58,8 @@ incs = [ ] incs = ' '.join(incs) -defs = ['GLEW_STATIC'] +defs = env['BF_GL_DEFINITIONS'] + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc','win32-mingw', 'win64-mingw'): if env['BF_DEBUG']: defs.append('_DEBUG') diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index 35a73193a24..74f36207774 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -54,7 +54,7 @@ #include "Exception.h" #include <memory.h> -#include "GL/glew.h" +#include "glew-mx.h" // macro for exception handling and logging |