[Bf-blender-cvs] [5a23177] soc-2013-viewport_fx: Fixes for errors building on XCode on Mac OSX Mavericks. (Has more to do with llvm gcc than the OS.)

Jason Wilkins noreply at git.blender.org
Fri Feb 14 19:09:25 CET 2014


Commit: 5a2317757dcb710492c556035006077c29939bbc
Author: Jason Wilkins
Date:   Fri Feb 14 11:36:21 2014 -0600
https://developer.blender.org/rB5a2317757dcb710492c556035006077c29939bbc

Fixes for errors building on XCode on Mac OSX Mavericks. (Has more to do with llvm gcc than the OS.)

Still have to refactor GHOST for OSX and move glClipPlane into GPU module.

===================================================================

M	CMakeLists.txt
M	intern/ghost/intern/GHOST_Context.cpp
M	intern/ghost/intern/GHOST_Window.cpp
M	intern/ghost/intern/GHOST_WindowCocoa.mm
M	source/blender/blenlib/BLI_utildefines.h
M	source/blender/blenlib/intern/path_util.c
M	source/blender/editors/include/ED_keyframes_draw.h
M	source/blender/editors/include/ED_uvedit.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/space_file/file_intern.h
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/space_view3d/view3d_intern.h
M	source/blender/gpu/GPU_buffers.h
M	source/blender/gpu/GPU_deprecated.h
M	source/blender/gpu/GPU_draw.h
M	source/blender/gpu/GPU_immediate.h
M	source/blender/gpu/GPU_safety.h
M	source/blender/gpu/intern/gpu_basic.c
M	source/blender/gpu/intern/gpu_common.c
M	source/blender/gpu/intern/gpu_common_intern.h
M	source/blender/gpu/intern/gpu_debug.c
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/gpu/intern/gpu_immediate.c
M	source/blender/gpu/intern/gpu_init_exit.c
M	source/blender/gpu/intern/gpu_lighting.c
M	source/blender/gpu/intern/gpu_matrix.c
M	source/blender/gpu/intern/gpu_pixels.c
M	source/blender/gpu/intern/gpu_raster.c
M	source/blender/gpu/intern/gpu_select.c
M	source/blender/gpu/intern/gpu_sprite.c
M	source/blender/gpu/intern/gpu_state_latch.c

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5aa05aa..1f030e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -345,7 +345,9 @@ if(APPLE)
 	endif()
 	
 	execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
-	if(${MAC_SYS} MATCHES 12)
+	if(${MAC_SYS} MATCHES 13)
+		set(OSX_SYSTEM 10.9)
+	elseif(${MAC_SYS} MATCHES 12)
 		set(OSX_SYSTEM 10.8)
 	elseif(${MAC_SYS} MATCHES 11)
 		set(OSX_SYSTEM 10.7)
diff --git a/intern/ghost/intern/GHOST_Context.cpp b/intern/ghost/intern/GHOST_Context.cpp
index f53e756..d0d7f0a 100644
--- a/intern/ghost/intern/GHOST_Context.cpp
+++ b/intern/ghost/intern/GHOST_Context.cpp
@@ -56,6 +56,7 @@ const char* get_glew_error_message_string(GLenum error)
 		case GLEW_ERROR_GLX_VERSION_11_ONLY:
 			return "GLX 1.2 or later is required.";
 
+#if WITH_GLEW_ES
 		case GLEW_ERROR_NOT_GLES_VERSION:
 			return "OpenGL ES is required.";
 
@@ -67,6 +68,7 @@ const char* get_glew_error_message_string(GLenum error)
 
 		case GLEW_ERROR_EGL_VERSION_10_ONLY:
 			return "EGL 1.1 or later is required.";
+#endif
 
 		default:
 			return NULL;
@@ -90,6 +92,7 @@ const char* get_glew_error_enum_string(GLenum error)
 		case GLEW_ERROR_GLX_VERSION_11_ONLY:
 			return "GLEW_ERROR_GLX_VERSION_11_ONLY";
 
+#if WITH_GLEW_ES
 		case GLEW_ERROR_NOT_GLES_VERSION:
 			return "GLEW_ERROR_NOT_GLES_VERSION";
 
@@ -101,6 +104,7 @@ const char* get_glew_error_enum_string(GLenum error)
 
 		case GLEW_ERROR_EGL_VERSION_10_ONLY:
 			return "GLEW_ERROR_EGL_VERSION_10_ONLY";
+#endif
 
 		default:
 			return NULL;
diff --git a/intern/ghost/intern/GHOST_Window.cpp b/intern/ghost/intern/GHOST_Window.cpp
index 17c65fe..0d6448a 100644
--- a/intern/ghost/intern/GHOST_Window.cpp
+++ b/intern/ghost/intern/GHOST_Window.cpp
@@ -52,12 +52,12 @@ GHOST_Window::GHOST_Window(
     const GHOST_TUns16 numOfAASamples
 )
 	: m_drawingContextType(GHOST_kDrawingContextTypeNone)
-	, m_context(new GHOST_ContextNone())
 	, m_cursorVisible(true)
 	, m_cursorGrab(GHOST_kGrabDisable)
 	, m_cursorShape(GHOST_kStandardCursorDefault)
 	, m_stereoVisual(stereoVisual)
 	, m_numOfAASamples(numOfAASamples)
+	, m_context(new GHOST_ContextNone())
 {
 	m_isUnsavedChanges = false;
 	m_canAcceptDragOperation = false;
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 472136b..caa67d9 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -517,7 +517,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 	GHOST_TDrawingContextType type,
 	const bool stereoVisual, const GHOST_TUns16 numOfAASamples
 ) :
-	GHOST_Window(width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual, false, numOfAASamples),
+	GHOST_Window(width, height, state, stereoVisual, false, numOfAASamples),
 	m_customCursor(0)
 {
 	NSOpenGLPixelFormatAttribute pixelFormatAttrsWindow[40];
@@ -565,9 +565,9 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 	pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore; 
 	
 	// Force software OpenGL, for debugging
-	if (getenv("BLENDER_SOFTWAREGL")) {
+	if (getenv("BLENDER_SOFTWAREGL")) { // XXX jwilkins: fixed this to work on Intel macs? useful feature for Windows and Linux too?  Maybe a command line flag is better...
 		pixelFormatAttrsWindow[i++] = NSOpenGLPFARendererID;
-		pixelFormatAttrsWindow[i++] = kCGLRendererGenericID;
+		pixelFormatAttrsWindow[i++] = kCGLRendererGenericFloatID;
 	}
 	else
 		pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
@@ -598,7 +598,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 	pixelFormatAttrsWindow[i] = (NSOpenGLPixelFormatAttribute) 0;
 	
 	pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttrsWindow];
-	
+
+	// XXX jwilkins: this code seems to have a lot of duplication from above?
 	
 	//Fall back to no multisampling if Antialiasing init failed
 	if (pixelFormat == nil) {
@@ -610,9 +611,9 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 		pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore;
 		
 		// Force software OpenGL, for debugging
-		if (getenv("BLENDER_SOFTWAREGL")) {
+		if (getenv("BLENDER_SOFTWAREGL")) {// XXX jwilkins: fixed this to work on Intel macs? useful feature for Windows and Linux too?  Maybe a command line flag is better...
 			pixelFormatAttrsWindow[i++] = NSOpenGLPFARendererID;
-			pixelFormatAttrsWindow[i++] = kCGLRendererGenericID;
+			pixelFormatAttrsWindow[i++] = kCGLRendererGenericFloatID;
 		}
 		else
 			pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 3d44d7d..d93d948 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -423,4 +423,8 @@
 	#endif
 #endif
 
+#ifndef _WIN32
+#define O_BINARY 0
+#endif
+
 #endif  /* __BLI_UTILDEFINES_H__ */
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 1f96c10..13c6219 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -77,6 +77,8 @@
 #  endif
 #endif /* WIN32 */
 
+#include <stddef.h>
+
 /* local */
 #define UNIQUE_NAME_MAX 128
 
diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h
index ffee46e..5cdb3d8 100644
--- a/source/blender/editors/include/ED_keyframes_draw.h
+++ b/source/blender/editors/include/ED_keyframes_draw.h
@@ -32,6 +32,8 @@
 #ifndef __ED_KEYFRAMES_DRAW_H__
 #define __ED_KEYFRAMES_DRAW_H__
 
+#include "BLI_utildefines.h"
+
 struct bAnimContext;
 struct AnimData;
 struct BezTriple;
diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h
index 2de9a5d..bd26100 100644
--- a/source/blender/editors/include/ED_uvedit.h
+++ b/source/blender/editors/include/ED_uvedit.h
@@ -47,6 +47,8 @@ struct SpaceImage;
 struct bContext;
 struct bNode;
 struct wmKeyConfig;
+struct SpaceImage;
+struct ARegion;
 
 /* uvedit_ops.c */
 void ED_operatortypes_uvedit(void);
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index a7332e0..d0d262a 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -59,6 +59,7 @@ struct bPoseChannel;
 struct bScreen;
 struct bglMats;
 struct rcti;
+struct rctf;
 struct wmOperator;
 struct wmOperatorType;
 struct wmWindow;
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index 3ebca2d..d8695bf 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -35,7 +35,9 @@
 
 struct ARegion;
 struct ARegionType;
+struct bContext;
 struct SpaceFile;
+struct ScrArea;
 
 /* file_ops.c */
 struct ARegion *file_buttons_region(struct ScrArea *sa);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index da45b91..4ae4418 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2202,10 +2202,10 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
 
 #if defined(WITH_GL_PROFILE_COMPAT)
 		if (use_displist) {
-			gpuMultMatrix(dob->mat);
+			gpuMultMatrix(dob->mat[0]);
 			if (ED_view3d_boundbox_clip(rv3d, dob->mat, &bb))
 				glCallList(displist);
-			gpuLoadMatrix(rv3d->viewmat);
+			gpuLoadMatrix(rv3d->viewmat[0]);
 		}
 		else
 #endif
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 4580137..a02ab00 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -51,6 +51,7 @@ struct Mesh;
 struct wmNDOFMotionData;
 struct wmOperatorType;
 struct wmWindowManager;
+struct ListBase;
 
 /* drawing flags: */
 enum {
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index 7f9525c..6f5dcde 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -38,7 +38,8 @@
 extern "C" {
 #endif
 
-
+struct BMesh;
+struct GHash;
 
 #ifdef _DEBUG
 /*#define DEBUG_VBO(X) printf(X)*/
diff --git a/source/blender/gpu/GPU_deprecated.h b/source/blender/gpu/GPU_deprecated.h
index 8d5e734..2598525 100644
--- a/source/blender/gpu/GPU_deprecated.h
+++ b/source/blender/gpu/GPU_deprecated.h
@@ -519,10 +519,10 @@
 #define GL_LIGHT7 DO_NOT_USE_GL_LIGHT7
 
 #undef GL_LIGHTING
-#define DO_NOT_USE_GL_LIGHTING
+#define GL_LIGHTING DO_NOT_USE_GL_LIGHTING
 
 #undef GL_COLOR_MATERIAL
-#define DO_NOT_USE_GL_COLOR_MATERIAL
+#define GL_COLOR_MATERIAL DO_NOT_USE_GL_COLOR_MATERIAL
 
 /* display lists */
 //#undef glCallList
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index fe608d2..b6aefb0 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -36,10 +36,26 @@
 
 #include "GPU_glew.h"
 
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+
+
+struct MTFace;
+struct Image;
+struct ImageUser;
+struct ImBuf;
+struct SmokeModifierData;
+struct RegionView3D;
+struct Object;
+struct Scene;
+struct View3D;
+
+
+
 /* OpenGL drawing functions related to shading. These are also
  * shared with the game engine, where there were previously
  * duplicates of some of these functions. */
diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h
index 8bfa658..a087f0a 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -55,6 +55,11 @@ extern "C" {
 
 
 
+struct GPUimmediate;
+struct GPUindex;
+
+
+
 void gpu_lock_buffer_gl(void);
 void gpu_unlock_buffer_gl(void);
 void gpu_begin_buffer_gl(void);
diff --git a/source/blender/gpu/GPU_safety.h b/source/blender/gpu/GPU_safety.h
index a9bab0e..4d008ee 100644
--- a/source/blender/gpu/GPU_safety.h
+++ b/source/blender/gpu/GPU_safety.h
@@ -69,6 +69,7 @@ void gpu_check(const char* file, int line, const char* text);
 /* Bails out of function even if assert or abort are disabled.
    Needs a variable in scope to store results of the test.
    Can be used in functions that return void if third argume

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list