mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
Merge branch 'master' of github.com:elmindreda/glfw
This commit is contained in:
+57
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user