[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58719] branches/soc-2013-viewport_fx: some fixes so that the ES profile compiles and runs properly

Jason Wilkins Jason.A.Wilkins at gmail.com
Mon Jul 29 18:09:58 CEST 2013


Revision: 58719
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58719
Author:   jwilkins
Date:     2013-07-29 16:09:57 +0000 (Mon, 29 Jul 2013)
Log Message:
-----------
some fixes so that the ES profile compiles and runs properly

Modified Paths:
--------------
    branches/soc-2013-viewport_fx/extern/glew-es/src/glew.c
    branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.cpp
    branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h
    branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_ContextEGL.cpp
    branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_WindowWin32.cpp
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_object_gles.c

Modified: branches/soc-2013-viewport_fx/extern/glew-es/src/glew.c
===================================================================
--- branches/soc-2013-viewport_fx/extern/glew-es/src/glew.c	2013-07-29 15:32:24 UTC (rev 58718)
+++ branches/soc-2013-viewport_fx/extern/glew-es/src/glew.c	2013-07-29 16:09:57 UTC (rev 58719)
@@ -421,17 +421,22 @@
 	  }
 	  return GL_FALSE;
 	}
+#ifndef GLEW_ES_ONLY
 	else { // XXX jwilkins: unified extension string is deprecated
-		GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC pglGetStringi = glewGetProcAddress("glGetStringi");
+		typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint);
+		GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC pglGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress("glGetStringi");
 
-		int max = 0;
-		glGetIntegerv(GL_NUM_EXTENSIONS, &max);
-
 		if (pglGetStringi != NULL) {
-			const char* ext;
+			const GLubyte* ext;
 			int i;
-			GLuint len = _glewStrLen((const GLubyte*)name);
+			int max = 0;
+			const GLenum NUM_EXTENSIONS = 0x821D;
+			GLuint len;
 
+			glGetIntegerv(NUM_EXTENSIONS, &max);
+
+			len = _glewStrLen((const GLubyte*)name);
+
 			for (i = 0; i < max; i++) {
 				ext = pglGetStringi(GL_EXTENSIONS, i);
 
@@ -440,6 +445,7 @@
 			}
 		}
 	}
+#endif
 
 	return GL_FALSE;
 }
@@ -11798,16 +11804,20 @@
   }		                     
 
   /* query opengl extensions string */
+#ifndef GLEW_ES_ONLY
   if (!GLEW_VERSION_3_0) {
+#endif
 	  extStart = glGetString(GL_EXTENSIONS);
 	  if (extStart == 0)
 		extStart = (const GLubyte*)"";
 	  extEnd = extStart + _glewStrLen(extStart);
+#ifndef GLEW_ES_ONLY
   }
   else { // XXX jwilkins: unified extension string is deprecated
 	  extStart = 0;
 	  extEnd   = 0;
   }
+#endif
 
   /* initialize extensions */
 #ifdef GL_VERSION_1_1

Modified: branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.cpp
===================================================================
--- branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.cpp	2013-07-29 15:32:24 UTC (rev 58718)
+++ branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.cpp	2013-07-29 16:09:57 UTC (rev 58719)
@@ -155,6 +155,7 @@
 
 int GHOST_PixelFormat::computeWeight() const
 {
+	return 0;
 }
 
 
@@ -165,6 +166,8 @@
 
 
 
-int GHOST_ChoosePixelFormat(GHOST_PixelFormatFactory& factory)
+int GHOST_PixelFormatChooser::choosePixelFormat(GHOST_PixelFormatChooser& factory)
 {
+	return 0;
 }
+

Modified: branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h
===================================================================
--- branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h	2013-07-29 15:32:24 UTC (rev 58718)
+++ branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h	2013-07-29 16:09:57 UTC (rev 58719)
@@ -133,12 +133,12 @@
 
 class GHOST_PixelFormatChooser {
 public:
-	int choosePixelFormat(GHOST_PixelFormatFactory& factory);
+	int choosePixelFormat(GHOST_PixelFormatChooser& factory);
 
 protected:
-	virtual int                systemChoosePixelFormat() const = 0;
-	virtual int                count()                   const = 0;
-	virtual GHOST_PixelFormat* get(int i)                const = 0;
+	virtual int                safeChoosePixelFormat() const = 0;
+	virtual int                count()                 const = 0;
+	virtual GHOST_PixelFormat* get(int i)              const = 0;
 };
 
 

Modified: branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_ContextEGL.cpp
===================================================================
--- branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_ContextEGL.cpp	2013-07-29 15:32:24 UTC (rev 58718)
+++ branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_ContextEGL.cpp	2013-07-29 16:09:57 UTC (rev 58719)
@@ -324,9 +324,6 @@
 {
 	std::vector<EGLint> attrib_list;
 
-	assert(m_nativeWindow  != NULL);
-	assert(m_nativeDisplay != NULL);
-
 	if (stereoVisual)
 		fprintf(stderr, "Warning! Stereo OpenGL ES contexts are not supported.\n");
 
@@ -437,6 +434,8 @@
 	if (!EGL_CHK(::eglMakeCurrent(m_display, m_surface, m_surface, m_context)))
 		goto error;
 
+	initGlew();
+
 	return GHOST_kSuccess;
 
 error:

Modified: branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-07-29 15:32:24 UTC (rev 58718)
+++ branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-07-29 16:09:57 UTC (rev 58719)
@@ -38,8 +38,14 @@
 #include "utfconv.h"
 #include "utf_winfunc.h"
 
+#if defined(WITH_GL_SYSTEM_DESKTOP)
 #include "GHOST_ContextWGL.h"
+#endif
 
+#if defined(WITH_GL_SYSTEM_EMBEDDED)
+#include "GHOST_ContextEGL.h"
+#endif
+
 #include <math.h>
 #include <string.h>
 #include <assert.h>

Modified: branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_object_gles.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_object_gles.c	2013-07-29 15:32:24 UTC (rev 58718)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_object_gles.c	2013-07-29 16:09:57 UTC (rev 58719)
@@ -310,7 +310,9 @@
 
 
 char * object_shader_vector_alphatexture = 
+#if defined(WITH_GL_PROFILE_CORE)
 "#version 120\n"
+#endif
 	"uniform mat4 b_ProjectionMatrix ;	\n"
 	"uniform mat4 b_ModelViewMatrix ;	\n"
 	"uniform mat4 b_TextureMatrix ;	\n"
@@ -339,7 +341,9 @@
 ;
 
 char * object_shader_vector_rgbatexture = 
+#if defined(WITH_GL_PROFILE_CORE)
 "#version 120\n"
+#endif
 	"uniform mat4 b_ProjectionMatrix ;\n"
 	"uniform mat4 b_ModelViewMatrix ;\n"
 	"uniform mat4 b_TextureMatrix ;\n"
@@ -368,7 +372,9 @@
 ;
 
 char * object_shader_vector_pixels = 
+#if defined(WITH_GL_PROFILE_CORE)
 "#version 120\n"
+#endif
 	"uniform mat4 b_ProjectionMatrix ;\n"
 	"uniform mat4 b_ModelViewMatrix ;\n"
 	"uniform mat4 b_TextureMatrix ;\n"




More information about the Bf-blender-cvs mailing list