Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Rauch <Rauch.Christian@gmx.de>2021-06-17 00:13:36 +0300
committerChristian Rauch <Rauch.Christian@gmx.de>2021-06-22 22:00:40 +0300
commitb35ba22d8439df35056957b9f1519e9150cc900b (patch)
tree1f2b45ddbbfe4a66e582fd7b877242fb5964308b
parentc6e6a9046e1b918adf7f5d172e84acf7768c09d9 (diff)
GHOST/EGL: getters for display, config and context
-rw-r--r--intern/ghost/intern/GHOST_ContextEGL.cpp25
-rw-r--r--intern/ghost/intern/GHOST_ContextEGL.h7
2 files changed, 26 insertions, 6 deletions
diff --git a/intern/ghost/intern/GHOST_ContextEGL.cpp b/intern/ghost/intern/GHOST_ContextEGL.cpp
index 6ec79aad045..770ead5962e 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextEGL.cpp
@@ -288,6 +288,21 @@ GHOST_TSuccess GHOST_ContextEGL::getSwapInterval(int &intervalOut)
return GHOST_kSuccess;
}
+EGLDisplay GHOST_ContextEGL::getDisplay() const
+{
+ return m_display;
+}
+
+EGLConfig GHOST_ContextEGL::getConfig() const
+{
+ return m_config;
+}
+
+EGLContext GHOST_ContextEGL::getContext() const
+{
+ return m_context;
+}
+
GHOST_TSuccess GHOST_ContextEGL::activateDrawingContext()
{
if (m_display) {
@@ -459,9 +474,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
attrib_list.push_back(EGL_NONE);
- EGLConfig config;
-
- if (!EGL_CHK(::eglChooseConfig(m_display, &(attrib_list[0]), &config, 1, &num_config)))
+ if (!EGL_CHK(::eglChooseConfig(m_display, &(attrib_list[0]), &m_config, 1, &num_config)))
goto error;
// A common error is to assume that ChooseConfig worked because it returned EGL_TRUE
@@ -469,7 +482,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
goto error;
if (m_nativeWindow != 0) {
- m_surface = ::eglCreateWindowSurface(m_display, config, m_nativeWindow, NULL);
+ m_surface = ::eglCreateWindowSurface(m_display, m_config, m_nativeWindow, NULL);
}
else {
static const EGLint pb_attrib_list[] = {
@@ -479,7 +492,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
1,
EGL_NONE,
};
- m_surface = ::eglCreatePbufferSurface(m_display, config, pb_attrib_list);
+ m_surface = ::eglCreatePbufferSurface(m_display, m_config, pb_attrib_list);
}
if (!EGL_CHK(m_surface != EGL_NO_SURFACE))
@@ -580,7 +593,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
attrib_list.push_back(EGL_NONE);
- m_context = ::eglCreateContext(m_display, config, m_sharedContext, &(attrib_list[0]));
+ m_context = ::eglCreateContext(m_display, m_config, m_sharedContext, &(attrib_list[0]));
if (!EGL_CHK(m_context != EGL_NO_CONTEXT))
goto error;
diff --git a/intern/ghost/intern/GHOST_ContextEGL.h b/intern/ghost/intern/GHOST_ContextEGL.h
index f828271d88d..88d78b159b9 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.h
+++ b/intern/ghost/intern/GHOST_ContextEGL.h
@@ -100,6 +100,12 @@ class GHOST_ContextEGL : public GHOST_Context {
*/
GHOST_TSuccess getSwapInterval(int &intervalOut);
+ EGLDisplay getDisplay() const;
+
+ EGLConfig getConfig() const;
+
+ EGLContext getContext() const;
+
private:
bool initContextEGLEW();
@@ -117,6 +123,7 @@ class GHOST_ContextEGL : public GHOST_Context {
EGLContext m_context;
EGLSurface m_surface;
EGLDisplay m_display;
+ EGLConfig m_config;
EGLint m_swap_interval;