Merge branch 'master' of github.com:elmindreda/glfw

This commit is contained in:
Camilla Berglund
2013-01-16 20:33:24 +01:00
20 changed files with 320 additions and 358 deletions
+57 -2
View File
@@ -113,7 +113,7 @@ static const char* getErrorString(EGLint error)
// Initialize EGL
//========================================================================
int _glfwInitOpenGL(void)
int _glfwInitContextAPI(void)
{
_glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY);
if (_glfw.egl.display == EGL_NO_DISPLAY)
@@ -145,7 +145,7 @@ int _glfwInitOpenGL(void)
// Terminate EGL
//========================================================================
void _glfwTerminateOpenGL(void)
void _glfwTerminateContextAPI(void)
{
eglTerminate(_glfw.egl.display);
}
@@ -497,3 +497,58 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
return eglGetProcAddress(procname);
}
//////////////////////////////////////////////////////////////////////////
////// GLFW native API //////
//////////////////////////////////////////////////////////////////////////
//========================================================================
// Return the EGL display
//========================================================================
GLFWAPI EGLDisplay glfwGetEGLDisplay(void)
{
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return NULL;
}
return _glfw.egl.display;
}
//========================================================================
// Return the WGL context of the specified window
//========================================================================
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return 0;
}
return window->egl.context;
}
//========================================================================
// Return the EGL surface of the specified window
//========================================================================
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
if (!_glfwInitialized)
{
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
return 0;
}
return window->egl.surface;
}