egl: implement public functions to obtain internal EGL handles
These functions allow applications to call EGL functions against the SDL EGL context. For example, applications can use an EGL API loader via SDL_EGL_GetCurrentDisplay and SDL_EGL_GetProcAddress, and can call functions such as eglQuerySurface against the internal EGLSurface and EGLDisplay.
This commit is contained in:
@@ -217,6 +217,13 @@ typedef enum
|
||||
*/
|
||||
typedef void *SDL_GLContext;
|
||||
|
||||
/**
|
||||
* \brief Opaque EGL types.
|
||||
*/
|
||||
typedef void *SDL_EGLDisplay;
|
||||
typedef void *SDL_EGLConfig;
|
||||
typedef void *SDL_EGLSurface;
|
||||
|
||||
/**
|
||||
* \brief OpenGL configuration attributes
|
||||
*/
|
||||
@@ -1903,6 +1910,21 @@ extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
|
||||
|
||||
/**
|
||||
* Get an EGL library function by name.
|
||||
*
|
||||
* If an EGL library is loaded, this function allows applications to get entry
|
||||
* points for EGL functions. This is useful to provide to an EGL API and
|
||||
* extension loader.
|
||||
*
|
||||
* \param proc the name of an EGL function
|
||||
* \returns a pointer to the named EGL function. The returned pointer should be
|
||||
* cast to the appropriate function signature.
|
||||
*
|
||||
* \sa SDL_GL_GetCurrentEGLDisplay
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_EGL_GetProcAddress(const char *proc);
|
||||
|
||||
/**
|
||||
* Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
|
||||
*
|
||||
@@ -2041,6 +2063,32 @@ extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void);
|
||||
*/
|
||||
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
|
||||
|
||||
/**
|
||||
* Get the currently active EGL display.
|
||||
*
|
||||
* \returns the currently active EGL display or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
*/
|
||||
extern DECLSPEC SDL_EGLDisplay SDLCALL SDL_EGL_GetCurrentEGLDisplay(void);
|
||||
|
||||
/**
|
||||
* Get the currently active EGL config.
|
||||
*
|
||||
* \returns the currently active EGL config or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
*/
|
||||
extern DECLSPEC SDL_EGLConfig SDLCALL SDL_EGL_GetCurrentEGLConfig(void);
|
||||
|
||||
/**
|
||||
* Get the EGL surface associated with the window.
|
||||
*
|
||||
* \returns the EGLSurface pointer associated with the window, or NULL on
|
||||
* failure.
|
||||
*/
|
||||
extern DECLSPEC SDL_EGLSurface SDLCALL SDL_EGL_GetWindowEGLSurface(SDL_Window * window);
|
||||
|
||||
/**
|
||||
* Get the size of a window's underlying drawable in pixels.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user