[Bf-blender-cvs] [c36fb0f] soc-2014-viewport_context: Warning cleanup and remove unused function
Campbell Barton
noreply at git.blender.org
Mon Jul 28 22:58:30 CEST 2014
Commit: c36fb0f4dc3ec569c3ef627652ebb8e82326dd76
Author: Campbell Barton
Date: Tue Jul 29 06:57:39 2014 +1000
Branches: soc-2014-viewport_context
https://developer.blender.org/rBc36fb0f4dc3ec569c3ef627652ebb8e82326dd76
Warning cleanup and remove unused function
===================================================================
M CMakeLists.txt
M intern/ghost/intern/GHOST_ContextEGL.cpp
M intern/ghost/intern/GHOST_ContextEGL.h
M intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4e8c01..aeb5c17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2147,6 +2147,8 @@ elseif(WITH_GL_PROFILE_ES20)
endif()
if(WITH_GL_EGL)
+ list(APPEND GL_DEFINITIONS -DWITH_GL_EGL)
+
if(WITH_SYSTEM_GLES)
if(NOT OPENGLES_EGL_LIBRARY)
message(FATAL_ERROR "Unable to find OpenGL ES libraries. Install them or disable WITH_SYSTEM_GLES.")
diff --git a/intern/ghost/intern/GHOST_ContextEGL.cpp b/intern/ghost/intern/GHOST_ContextEGL.cpp
index 8308125..8a4c33d 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextEGL.cpp
@@ -39,6 +39,7 @@
#include <cassert>
#include <cstdio>
+#include <cstring>
#ifdef WITH_GLEW_MX
@@ -168,14 +169,17 @@ static inline bool bindAPI(EGLenum api)
#ifdef WITH_GLEW_MX
if (eglewContext != NULL)
#endif
- if (EGLEW_VERSION_1_2)
- return EGL_CHK(eglBindAPI(api)) == EGL_TRUE;
- else
- return false;
+ {
+ if (EGLEW_VERSION_1_2) {
+ return (EGL_CHK(eglBindAPI(api)) == EGL_TRUE);
+ }
+ }
+
+ return false;
}
-#if defined(WITH_GL_ANGLE)
+#ifdef WITH_GL_ANGLE
HMODULE GHOST_ContextEGL::s_d3dcompiler = NULL;
#endif
@@ -220,8 +224,8 @@ GHOST_ContextEGL::GHOST_ContextEGL(
EGLint contextResetNotificationStrategy,
EGLenum api)
: GHOST_Context(stereoVisual, numOfAASamples),
- m_nativeWindow (nativeWindow),
m_nativeDisplay(nativeDisplay),
+ m_nativeWindow (nativeWindow),
m_contextProfileMask(contextProfileMask),
m_contextMajorVersion(contextMajorVersion),
m_contextMinorVersion(contextMinorVersion),
@@ -238,7 +242,7 @@ GHOST_ContextEGL::GHOST_ContextEGL(
m_sharedContext(choose_api(api, s_gl_sharedContext, s_gles_sharedContext, s_vg_sharedContext)),
m_sharedCount (choose_api(api, s_gl_sharedCount, s_gles_sharedCount, s_vg_sharedCount))
{
- assert(m_nativeWindow != NULL);
+ assert(m_nativeWindow != 0);
assert(m_nativeDisplay != NULL);
}
@@ -340,19 +344,6 @@ void GHOST_ContextEGL::initContextEGLEW()
}
-static std::set<std::string> split(const std::string s, char delim = ' ')
-{
- std::set<std::string> elems;
- std::stringstream ss(s);
- std::string item;
-
- while (std::getline(ss, item, delim))
- elems.insert(item);
-
- return elems;
-}
-
-
static const std::string &api_string(EGLenum api)
{
static const std::string a("OpenGL");
@@ -373,7 +364,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
m_stereoVisual = false; // It doesn't matter what the Window wants.
-#if defined(WITH_GL_ANGLE)
+#ifdef WITH_GL_ANGLE
// d3dcompiler_XX.dll needs to be loaded before ANGLE will work
if (s_d3dcompiler == NULL) {
s_d3dcompiler = LoadLibrary(D3DCOMPILER);
@@ -637,7 +628,7 @@ error:
GHOST_TSuccess GHOST_ContextEGL::releaseNativeHandles()
{
- m_nativeWindow = NULL;
+ m_nativeWindow = 0;
m_nativeDisplay = NULL;
return GHOST_kSuccess;
diff --git a/intern/ghost/intern/GHOST_ContextEGL.h b/intern/ghost/intern/GHOST_ContextEGL.h
index 553acf2..5e45813 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.h
+++ b/intern/ghost/intern/GHOST_ContextEGL.h
@@ -159,7 +159,7 @@ private:
static EGLContext s_vg_sharedContext;
static EGLint s_vg_sharedCount;
-#if defined(WITH_GL_ANGLE)
+#ifdef WITH_GL_ANGLE
static HMODULE s_d3dcompiler;
#endif
};
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 275aa47..6ff42aa 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -1084,7 +1084,6 @@ GHOST_WindowX11::
}
-
GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type)
{
if (type == GHOST_kDrawingContextTypeOpenGL) {
More information about the Bf-blender-cvs
mailing list