[Bf-blender-cvs] [dac03fc] soc-2014-viewport_context: Cleanup and some changes needed to build on linux

Campbell Barton noreply at git.blender.org
Thu Jul 24 10:20:38 CEST 2014


Commit: dac03fce6ef1f5f3587f487fd4d0b636de43075d
Author: Campbell Barton
Date:   Thu Jul 24 18:20:11 2014 +1000
Branches: soc-2014-viewport_context
https://developer.blender.org/rBdac03fce6ef1f5f3587f487fd4d0b636de43075d

Cleanup and some changes needed to build on linux

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

M	intern/ghost/intern/GHOST_ContextGLX.cpp
M	intern/glew-mx/glew-mx.h
M	intern/glew-mx/intern/glew-mx.c
M	source/blender/editors/armature/CMakeLists.txt
M	source/blender/gpu/GPU_glew.h
M	source/blender/gpu/GPU_init_exit.h
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_init_exit.c
M	source/blender/gpu/intern/gpu_select.c

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

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 8cd5ee6..6740124 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -63,8 +63,8 @@ GHOST_ContextGLX::GHOST_ContextGLX(
 	int          contextResetNotificationStrategy
 )
 	: GHOST_Context(stereoVisual, numOfAASamples)
-	, m_window (window)
 	, m_display(display)
+	, m_window (window)
 	, m_contextProfileMask              (contextProfileMask)
 	, m_contextMajorVersion             (contextMajorVersion)
 	, m_contextMinorVersion             (contextMinorVersion)
diff --git a/intern/glew-mx/glew-mx.h b/intern/glew-mx/glew-mx.h
index d1cc1d2..2af7f22 100644
--- a/intern/glew-mx/glew-mx.h
+++ b/intern/glew-mx/glew-mx.h
@@ -30,8 +30,8 @@
  * GLEW Context Management
  */
 
-#ifndef GLEW_MX_H__
-#define GLEW_MX_H__
+#ifndef __GLEW_MX_H__
+#define __GLEW_MX_H__
 
 #if GLEW_MX
 #define glewGetContext() _mxContext
@@ -58,12 +58,12 @@ void mxDestroyContext(GLEWContext* ctx);
 
 #else
 
-#include <stdlib.h> // for NULL
+#include <stdlib.h>  /* for NULL */
 
 #define mxSetContext(ctx)
 #define mxCreateContext() NULL
 #define mxDestroyContext(ctx)
 
-#endif // GLEW_MX
+#endif  /* GLEW_MX */
 
-#endif
+#endif  /* __GLEW_MX_H__ */
diff --git a/intern/glew-mx/intern/glew-mx.c b/intern/glew-mx/intern/glew-mx.c
index 8197645..da9ef85 100644
--- a/intern/glew-mx/intern/glew-mx.c
+++ b/intern/glew-mx/intern/glew-mx.c
@@ -50,7 +50,7 @@ void mxSetContext(GLEWContext* ctx)
 	_mxContext = ctx;
 }
 
-GLEWContext* mxCreateContext()
+GLEWContext* mxCreateContext(void)
 {
 	GLEWContext* ctx = malloc(sizeof(GLEWContext));
 
diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt
index 8c71fd8..fc211f0 100644
--- a/source/blender/editors/armature/CMakeLists.txt
+++ b/source/blender/editors/armature/CMakeLists.txt
@@ -27,7 +27,6 @@ set(INC
 	../../makesdna
 	../../makesrna
 	../../windowmanager
-	../../gpu
 	../../../../intern/guardedalloc
 	../../../../intern/glew-mx
 )
diff --git a/source/blender/gpu/GPU_glew.h b/source/blender/gpu/GPU_glew.h
index cab48ef..3ae8b5b 100644
--- a/source/blender/gpu/GPU_glew.h
+++ b/source/blender/gpu/GPU_glew.h
@@ -29,40 +29,32 @@
  *  \ingroup gpu
  */
 
-#ifndef _GPU_GLEW_H_
-#define _GPU_GLEW_H_
+#ifndef __GPU_GLEW_H__
+#define __GPU_GLEW_H__
 
 #include "glew-mx.h"
 
-
-
 /*
-The following section is for any simple stuff that is missing from GLEW when
-compiled with either the GLEW_ES_ONLY or the GLEW_NO_ES flag.
-
-Should limit this to simple things.
-More complex version shims should be placed elsewhere.
-
-Also, only put in stuff as it is needed.
-*/
-
-
+ * The following section is for any simple stuff that is missing from GLEW when
+ * compiled with either the GLEW_ES_ONLY or the GLEW_NO_ES flag.
+ *
+ * Should limit this to simple things.
+ * More complex version shims should be placed elsewhere.
+ *
+ * Also, only put in stuff as it is needed.
+ */
 
 #if defined(GLEW_ES_ONLY)
 
-
-
 /* ES does not support the GLdouble type. */
 #ifndef GLdouble
 #define GLdouble double
 #endif
 
-
-
 /*
-Need stubs for these version checks if compiling with only ES support.
-Rely on compiler to eliminate unreachable code when version checks become constants.
-*/
+ * Need stubs for these version checks if compiling with only ES support.
+ * Rely on compiler to eliminate unreachable code when version checks become constants.
+ */
 
 #ifndef GLEW_VERSION_1_1
 #define GLEW_VERSION_1_1 0
@@ -159,13 +151,13 @@ Rely on compiler to eliminate unreachable code when version checks become consta
 
 
 /*
-The following symbolic constants are missing from an ES only header,
-so alias them to their (same valued) extension versions which are available in the header.
-
-Be careful that this does not lead to unguarded use of what are extensions in ES!
-
-Some of these may be here simply to patch inconsistencies in the header files.
-*/
+ * The following symbolic constants are missing from an ES only header,
+ * so alias them to their (same valued) extension versions which are available in the header.
+ *
+ * Be careful that this does not lead to unguarded use of what are extensions in ES!
+ *
+ * Some of these may be here simply to patch inconsistencies in the header files.
+ */
 
 // XXX jwilkins: need to check ALL of these to make sure you didn't cover an unguarded use of an extension/version
 
@@ -242,16 +234,14 @@ Some of these may be here simply to patch inconsistencies in the header files.
 #endif
 
 
-
 /* end of defined(GLEW_ES_ONLY) */
 #elif defined(GLEW_NO_ES)
 
 
-
 /*
-Need stubs for these version checks if compiling without any support.
-Rely on compiler to eliminate unreachable code when version checks become constants
-*/
+ * Need stubs for these version checks if compiling without any support.
+ * Rely on compiler to eliminate unreachable code when version checks become constants
+ */
 
 #ifndef GLEW_ES_VERSION_2_0
 #define GLEW_ES_VERSION_2_0 0
@@ -302,16 +292,15 @@ Rely on compiler to eliminate unreachable code when version checks become consta
 #endif
 
 
-
 /*
-The following symbolic constants are missing when there is no ES support,
-so alias them to their (same valued) extension versions which are available in the header.
-
-Desktop GL typically does not have any extensions that originated from ES,
-unlike ES which has many extensions to replace what was taken out.
-
-For that reason these aliases are more likely just patching inconsistencies in the header files.
-*/
+ * The following symbolic constants are missing when there is no ES support,
+ * so alias them to their (same valued) extension versions which are available in the header.
+ *
+ * Desktop GL typically does not have any extensions that originated from ES,
+ * unlike ES which has many extensions to replace what was taken out.
+ *
+ * For that reason these aliases are more likely just patching inconsistencies in the header files.
+ */
 
 #ifndef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
@@ -324,6 +313,4 @@ For that reason these aliases are more likely just patching inconsistencies in t
 #endif /* defined(GLEW_NO_ES) */
 
 
-
-
 #endif /* _GPU_GLEW_H_ */
diff --git a/source/blender/gpu/GPU_init_exit.h b/source/blender/gpu/GPU_init_exit.h
index 41c744e..e89c970 100644
--- a/source/blender/gpu/GPU_init_exit.h
+++ b/source/blender/gpu/GPU_init_exit.h
@@ -29,8 +29,8 @@
  *  \ingroup gpu
  */
 
-#ifndef _GPU_INIT_EXIT_H_
-#define _GPU_INIT_EXIT_H_
+#ifndef __GPU_INIT_EXIT_H__
+#define __GPU_INIT_EXIT_H__
 
 #ifdef __cplusplus
 extern "C" {
@@ -43,4 +43,4 @@ void GPU_exit(void);
 }
 #endif
 
-#endif /* _GPU_INIT_EXIT_H_ */
+#endif /* __GPU_INIT_EXIT_H__ */
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index b200953..d36c03b 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1880,12 +1880,12 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[4][
 	return count;
 }
 
-void GPU_multisample(bool enable)
+static void gpu_multisample(bool enable)
 {
 	if (GLEW_VERSION_1_3 || GLEW_ARB_multisample) {
-#if __linux__
+#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 */
+		 * 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)) {
@@ -1983,7 +1983,7 @@ void GPU_state_init(void)
 	glCullFace(GL_BACK);
 	glDisable(GL_CULL_FACE);
 
-	GPU_multisample(false);
+	gpu_multisample(false);
 }
 
 #ifdef DEBUG
diff --git a/source/blender/gpu/intern/gpu_init_exit.c b/source/blender/gpu/intern/gpu_init_exit.c
index ba19688..6f75a00 100644
--- a/source/blender/gpu/intern/gpu_init_exit.c
+++ b/source/blender/gpu/intern/gpu_init_exit.c
@@ -29,21 +29,15 @@
  *  \ingroup gpu
  */
 
-/* my interface */
-#include "GPU_init_exit.h"
-
-/* intern */
+#include "BLI_sys_types.h"
+#include "GPU_init_exit.h"  /* interface */
+#include "GPU_extensions.h"  /* library */
 #include "intern/gpu_codegen.h"
 
-/* my library */
-#include "GPU_extensions.h"
-
-/*
-
-although the order of initialization and shutdown should not matter
-(except for the extensions), I chose alphabetical and reverse alphabetical order
-
-*/
+/**
+ * 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;
 
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c
index 2df9e60..347d5fb 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -31,6 +31,7 @@
  */
 #include "GPU_select.h"
 #include "GPU_extensions.h"
+#include "GPU_glew.h"
 
 #include "BLI_utildefines.h"
 
@@ -38,7 +39,6 @@
 
 #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




More information about the Bf-blender-cvs mailing list