[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58373] branches/soc-2013-viewport_fx: well on the way to conditionally compiling / rewriting non-ES and deprecated functions.

Jason Wilkins Jason.A.Wilkins at gmail.com
Fri Jul 19 08:00:12 CEST 2013


Revision: 58373
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58373
Author:   jwilkins
Date:     2013-07-19 06:00:11 +0000 (Fri, 19 Jul 2013)
Log Message:
-----------
well on the way to conditionally compiling / rewriting non-ES and deprecated functions.  still kind of a mess.  doesn't compile

Modified Paths:
--------------
    branches/soc-2013-viewport_fx/CMakeLists.txt
    branches/soc-2013-viewport_fx/extern/CMakeLists.txt
    branches/soc-2013-viewport_fx/extern/glew-es/CMakeLists.txt
    branches/soc-2013-viewport_fx/extern/glew-es/include/GL/eglew.h
    branches/soc-2013-viewport_fx/extern/glew-es/include/GL/glesew.h
    branches/soc-2013-viewport_fx/extern/glew-es/src/glew.c
    branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_WindowWin32.cpp
    branches/soc-2013-viewport_fx/source/blender/blenfont/intern/blf.c
    branches/soc-2013-viewport_fx/source/blender/editors/armature/editarmature_sketch.c
    branches/soc-2013-viewport_fx/source/blender/editors/interface/interface.c
    branches/soc-2013-viewport_fx/source/blender/editors/interface/interface_icons.c
    branches/soc-2013-viewport_fx/source/blender/editors/interface/interface_regions.c
    branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c
    branches/soc-2013-viewport_fx/source/blender/editors/sculpt_paint/paint_cursor.c
    branches/soc-2013-viewport_fx/source/blender/editors/space_node/node_draw.c
    branches/soc-2013-viewport_fx/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/soc-2013-viewport_fx/source/blender/editors/space_view3d/drawarmature.c
    branches/soc-2013-viewport_fx/source/blender/editors/space_view3d/drawvolume.c
    branches/soc-2013-viewport_fx/source/blender/editors/space_view3d/view3d_draw.c
    branches/soc-2013-viewport_fx/source/blender/editors/transform/transform.c
    branches/soc-2013-viewport_fx/source/blender/editors/transform/transform_manipulator.c
    branches/soc-2013-viewport_fx/source/blender/editors/uvedit/uvedit_smart_stitch.c
    branches/soc-2013-viewport_fx/source/blender/gpu/GPU_compatibility.h
    branches/soc-2013-viewport_fx/source/blender/gpu/GPU_utility.h
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_buffers.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_debug.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_draw.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extension_wrapper.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extension_wrapper.h
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_extensions.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_glew.h
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_immediate.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_primitives.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_simple_shader.c
    branches/soc-2013-viewport_fx/source/blender/makesrna/intern/rna_image_api.c
    branches/soc-2013-viewport_fx/source/blender/python/generic/bgl.c
    branches/soc-2013-viewport_fx/source/blender/python/generic/bgl.h
    branches/soc-2013-viewport_fx/source/blender/python/intern/CMakeLists.txt
    branches/soc-2013-viewport_fx/source/blender/python/intern/bpy_interface.c
    branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_draw.c

Modified: branches/soc-2013-viewport_fx/CMakeLists.txt
===================================================================
--- branches/soc-2013-viewport_fx/CMakeLists.txt	2013-07-19 00:09:03 UTC (rev 58372)
+++ branches/soc-2013-viewport_fx/CMakeLists.txt	2013-07-19 06:00:11 UTC (rev 58373)
@@ -325,16 +325,7 @@
 
 if(WIN32)
 	option(WITH_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
-
-	# ToDo: Add ANGLE to the lib directory
-	set(ANGLE_INCLUDE_PATH "" CACHE PATH "Path to ANGLE include files")
-	set(ANGLE_LIBRARY      "" CACHE PATH "Path to ANGLE library file")
-
-	mark_as_advanced(
-		WITH_ANGLE
-		ANGLE_INCLUDE_PATH
-		ANGLE_LIBRARY
-	)
+	mark_as_advanced(WITH_ANGLE)
 endif()
 
 # Code Coverage
@@ -1953,38 +1944,43 @@
 #-----------------------------------------------------------------------------
 # Configure OpenGL.
 
+# sanity checking
 if(WITH_GL_SYSTEM_EMBEDDED AND (WITH_GL_SYSTEM_LEGACY OR WITH_GL_SYSTEM_DESKTOP))
 	message(FATAL_ERROR "WITH_GL_SYSTEM_EMBEDDED cannot be used at the same time as WITH_GL_SYSTEM_LEGACY or WITH_GL_SYSTEM_DESKTOP")
 endif()
 
+# ToDo: Automatically find system OpenGL ES?
+set(OES2_INCLUDE_PATH "" CACHE PATH     "Path to OpenGL ES 2 include files")
+set(OES2_LIBRARY      "" CACHE FILEPATH "OpenGL ES 2 library file")
+
+mark_as_advanced(
+	OES2_INCLUDE_PATH
+	OES2_LIBRARY
+)
+
+if(WIN32)
+	# ToDo: Add ANGLE to the lib directory
+	set(ANGLE_INCLUDE_PATH "" CACHE PATH     "Path to ANGLE include files")
+	set(ANGLE_LIBRARY      "" CACHE FILEPATH "ANGLE library file")
+
+	mark_as_advanced(
+		ANGLE_INCLUDE_PATH
+		ANGLE_LIBRARY
+	)
+endif()
+
 if(WITH_GL_SYSTEM_EMBEDDED)
 	if(WITH_ANGLE)
-		set(ANGLE_INCLUDE_DIR "" CACHE PATH     "Path to ANGLE include files")
-		set(ANGLE_LIBRARY     "" CACHE FILEPATH "ANGLE library file")
-
-		mark_as_advanced(
-			ANGLE_INCLUDE_DIR
-			ANGLE_LIBRARY
-		)
-
-		set(SYSTEM_GL_INCLUDE_DIR "${ANGLE_INCLUDE_DIR}")
+		#set(SYSTEM_GL_INCLUDE_DIR "${ANGLE_INCLUDE_PATH}")
 		set(SYSTEM_GL_LIBRARIES   "${ANGLE_LIBRARY}")
 	else()
-		set(OPENGLES_INCLUDE_DIR "" CACHE PATH     "Path to OpenGL ES include files")
-		set(OPENGLES_LIBRARIES   "" CACHE FILEPATH "OpenGL ES library file")
-
-		mark_as_advanced(
-			OPENGLES_INCLUDE_DIR
-			OPENGLES_LIBRARY
-		)
-
-		set(SYSTEM_GL_INCLUDE_DIR "${OPENGLES_INCLUDE_DIR}")
-		set(SYSTEM_GL_LIBRARIES   "${OPENGLES_LIBRARY}")
+		#set(SYSTEM_GL_INCLUDE_PATH "${OES2_INCLUDE_PATH}")
+		set(SYSTEM_GL_LIBRARIES    "${OES2_LIBRARY}")
 	endif()
 else(WITH_GL_SYSTEM_LEGACY OR WITH_GL_SYSTEM_DESKTOP)
 	find_package(OpenGL)
 
-	set(SYSTEM_GL_INCLUDE_DIR "${OPENGL_INCLUDE_DIR}")
+	#set(SYSTEM_GL_INCLUDE_DIR "${OPENGL_INCLUDE_DIR}")
 	set(SYSTEM_GL_LIBRARIES   "${OPENGL_gl_LIBRARY}")
 
 	if(WITH_GLU)
@@ -1992,7 +1988,7 @@
 	endif()
 endif()
 
-blender_include_dirs_sys("${SYSTEM_GL_INCLUDE_DIR}")
+#blender_include_dirs_sys("${SYSTEM_GL_INCLUDE_DIR}")
 
 if(WITH_GL_PROFILE_COMPAT)
 	set(GL_DEFINITIONS "${GL_DEFINITIONS} -DWITH_GL_PROFILE_COMPAT")
@@ -2064,6 +2060,9 @@
 		set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
 
 		set(GL_DEFINITIONS "${GL_DEFINITIONS} -DWITH_GLEW_ES")
+		set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGL_ES_VERSION_1_0=0")
+		set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGL_ES_VERSION_CL_1_1=0")
+		set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGL_ES_VERSION_CM_1_1=0")
 
 		# this isn't strictly required, but potentally makes GLEW smaller and helps catch unguarded API usage
 		if(NOT WITH_GL_PROFILE_ES20)
@@ -2075,13 +2074,16 @@
 		endif()
 
 		if (WITH_GL_PROFILE_ES20)
-			set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGLEW_USE_LIB_ES2_0")
+			set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGLEW_USE_LIB_ES20")
 		endif()
 
 		if(WITH_GL_SYSTEM_EMBEDDED)
 			set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGLEW_INC_EGL")
 		endif()
 	else()
+		# this won't affect the normal glew library, but is used for conditional compilation elsewhere
+		set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGLEW_NO_ES")
+
 		set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
 	endif()
 endif()
@@ -2446,6 +2448,7 @@
 
 	info_cfg_text("OpenGL:")
 	info_cfg_option(WITH_GLEW_ES)
+	info_cfg_option(WITH_GLU)
 	info_cfg_option(WITH_GL_SYSTEM_LEGACY)
 	info_cfg_option(WITH_GL_SYSTEM_DESKTOP)
 	info_cfg_option(WITH_GL_SYSTEM_EMBEDDED)

Modified: branches/soc-2013-viewport_fx/extern/CMakeLists.txt
===================================================================
--- branches/soc-2013-viewport_fx/extern/CMakeLists.txt	2013-07-19 00:09:03 UTC (rev 58372)
+++ branches/soc-2013-viewport_fx/extern/CMakeLists.txt	2013-07-19 06:00:11 UTC (rev 58373)
@@ -47,7 +47,7 @@
 endif()
 
 if(NOT WITH_SYSTEM_GLEW)
-	if(WITH_GL_EXPERIMENTAL_GLEW)
+	if(WITH_GLEW_ES)
 		add_subdirectory(glew-es)
 	else()
 		add_subdirectory(glew)

Modified: branches/soc-2013-viewport_fx/extern/glew-es/CMakeLists.txt
===================================================================
--- branches/soc-2013-viewport_fx/extern/glew-es/CMakeLists.txt	2013-07-19 00:09:03 UTC (rev 58372)
+++ branches/soc-2013-viewport_fx/extern/glew-es/CMakeLists.txt	2013-07-19 06:00:11 UTC (rev 58373)
@@ -38,11 +38,11 @@
 set(SRC
 	src/glew.c
 
+	include/GL/eglew.h
+    include/GL/glesew.h
 	include/GL/glew.h
 	include/GL/glxew.h
 	include/GL/wglew.h
-    include/GL/glesew.h
-    include/GL/eglew.h
 )
 
 add_definitions(${GL_DEFINITIONS})

Modified: branches/soc-2013-viewport_fx/extern/glew-es/include/GL/eglew.h
===================================================================
--- branches/soc-2013-viewport_fx/extern/glew-es/include/GL/eglew.h	2013-07-19 00:09:03 UTC (rev 58372)
+++ branches/soc-2013-viewport_fx/extern/glew-es/include/GL/eglew.h	2013-07-19 06:00:11 UTC (rev 58373)
@@ -518,6 +518,10 @@
 #if !defined(EGL_ANDROID_blob_cache) 
 #define EGL_ANDROID_blob_cache 1
 
+typedef khronos_ssize_t EGLsizeiANDROID; // XXX jwilkins: missing typedef
+typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, void* value, EGLsizeiANDROID valueSize); // XXX jwilkins: missing typedef
+typedef void (*EGLSetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, const void* value, EGLsizeiANDROID valueSize); // XXX jwilkins: missing typedef
+
 typedef void (EGLAPIENTRY * PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
 
 #define eglSetBlobCacheFuncsANDROID EGLEW_GET_FUN(__eglewSetBlobCacheFuncsANDROID)
@@ -553,6 +557,8 @@
 #if !defined(EGL_ANDROID_native_fence_sync) 
 #define EGL_ANDROID_native_fence_sync 1
 
+typedef void* EGLSyncKHR; // XXX jwilkins: missing typedef
+
 #define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144
 #define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145
 #define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146
@@ -931,6 +937,8 @@
 
 #define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
 
+typedef void* EGLStreamKHR; // XXX jwilkins: missing typedef
+
 typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
 typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
 typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
@@ -948,6 +956,8 @@
 #if !defined(EGL_KHR_stream_cross_process_fd) 
 #define EGL_KHR_stream_cross_process_fd 1
 
+typedef int EGLNativeFileDescriptorKHR; // XXX jwilkins: missing typedef
+
 typedef EGLStreamKHR (EGLAPIENTRY * PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
 typedef EGLNativeFileDescriptorKHR (EGLAPIENTRY * PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
 
@@ -1021,6 +1031,8 @@
 #if !defined(EGL_KHR_wait_sync) 
 #define EGL_KHR_wait_sync 1
 
+typedef void* EGLSyncKHR; // XXX jwilkins: missing typedef
+
 typedef EGLint (EGLAPIENTRY * PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
 
 #define eglWaitSyncKHR EGLEW_GET_FUN(__eglewWaitSyncKHR)

Modified: branches/soc-2013-viewport_fx/extern/glew-es/include/GL/glesew.h
===================================================================
--- branches/soc-2013-viewport_fx/extern/glew-es/include/GL/glesew.h	2013-07-19 00:09:03 UTC (rev 58372)
+++ branches/soc-2013-viewport_fx/extern/glew-es/include/GL/glesew.h	2013-07-19 06:00:11 UTC (rev 58373)
@@ -88,8 +88,26 @@
 /* Internal convenience typedefs */
 typedef void (*_GLfuncptr)();
 
+// XXX jwilkins: had to add these
+#if defined(_MSC_VER) && _MSC_VER < 1400
+typedef __int64 GLint64EXT;
+typedef unsigned __int64 GLuint64EXT;
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
+typedef signed long long GLint64EXT;
+typedef unsigned long long GLuint64EXT;
+#else
+#  if defined(__MINGW32__) || defined(__CYGWIN__)
+#include <inttypes.h>
+#  endif
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+#endif
+typedef GLint64EXT  GLint64;
+typedef GLuint64EXT GLuint64;
+typedef struct __GLsync *GLsync;
 
 
+
 /********************* GL_ES_VERSION_1_0 functions common with OpenGL 1.1 *************************/
 
 
@@ -1002,6 +1020,20 @@
 #define GL_MAX_VARYING_VECTORS 0x8DFC
 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
 
+#define GL_VIEWPORT 0x0BA2 // XXX missing enum
+#define GL_SCISSOR_BOX 0x0C10 // XXX missing enum
+#define GL_GENERATE_MIPMAP_HINT 0x8192 // XXX missing enum
+#define GL_ARRAY_BUFFER 0x8892 // XXX missing enum
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893 // XXX missing enum
+#define GL_ARRAY_BUFFER_BINDING 0x8894 // XXX missing enum
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 // XXX missing enum
+#define GL_STATIC_DRAW 0x88E4 // XXX missing enum
+#define GL_DYNAMIC_DRAW 0x88E8 // XXX missing enum
+
+typedef char             GLchar; // XXX jwilkins: this typedef is missing when ES 1.1 is not enabled
+typedef khronos_intptr_t GLintptr; // XXX
+typedef khronos_ssize_t  GLsizeiptr; // XXX
+
 typedef void  (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
 typedef void  (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name);
 typedef void  (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
@@ -1087,6 +1119,16 @@
 typedef void  (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint indx, const GLfloat* values);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list