瀏覽代碼

Merge branch 'master' of https://github.com/taylor001/crown

mikymod 12 年之前
父節點
當前提交
67b323622c
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 2 1
      engine/renderers/gles/egl/GLContext.cpp
  2. 4 5
      engine/renderers/gles/egl/GLContext.h

+ 2 - 1
engine/renderers/gles/egl/GLContext.cpp

@@ -72,7 +72,7 @@ static const char* egl_error_to_string(EGLint error)
 
 //-----------------------------------------------------------------------------
 GLContext::GLContext()
-	: num_configs(0)
+	: display(EGL_NO_DISPLAY), surface(EGL_NO_SURFACE), context(EGL_NO_CONTEXT), num_configs(0)
 {
 }
 
@@ -92,6 +92,7 @@ void GLContext::create_context()
 	EGLint attributes[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
 
 	display = EGL_CHECK(eglGetDisplay(EGL_DEFAULT_DISPLAY));
+	CE_ASSERT(display != EGL_NO_DISPLAY, "Failed to obtain EGL display connection");
 
 	EGL_CHECK(eglInitialize(display, NULL, NULL));
 

+ 4 - 5
engine/renderers/gles/egl/GLContext.h

@@ -27,7 +27,6 @@ OTHER DEALINGS IN THE SOFTWARE.
 #pragma once
 
 #include <EGL/egl.h>
-#include <android/native_window.h>
 
 namespace crown
 {
@@ -45,11 +44,11 @@ public:
 private:
 
 	EGLDisplay 		display;
-    EGLSurface 		surface;
-    EGLConfig 		config;
-    EGLContext 		context;
+	EGLSurface 		surface;
+	EGLConfig 		config;
+	EGLContext 		context;
 
-    int32_t			num_configs;
+	int32_t			num_configs;
 };
 
 } // namespace crown