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:
Diffstat (limited to 'intern/ghost/intern/GHOST_ContextGLX.cpp')
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 90d810b7986..d4f67da1242 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -62,6 +62,7 @@ GHOST_ContextGLX::GHOST_ContextGLX(
Window window,
Display *display,
XVisualInfo *visualInfo,
+ GLXFBConfig fbconfig,
int contextProfileMask,
int contextMajorVersion,
int contextMinorVersion,
@@ -70,6 +71,7 @@ GHOST_ContextGLX::GHOST_ContextGLX(
: GHOST_Context(stereoVisual, numOfAASamples),
m_display(display),
m_visualInfo(visualInfo),
+ m_fbconfig(fbconfig),
m_window(window),
m_contextProfileMask(contextProfileMask),
m_contextMajorVersion(contextMajorVersion),
@@ -285,19 +287,24 @@ const bool GLXEW_ARB_create_context_robustness =
attribs[i++] = 0;
/* Create a GL 3.x context */
- GLXFBConfig *framebuffer_config = NULL;
- {
- int glx_attribs[64];
- int fbcount = 0;
+ if (m_fbconfig) {
+ m_context = glXCreateContextAttribsARB(m_display, m_fbconfig, s_sharedContext, true, attribs);
+ }
+ else {
+ GLXFBConfig *framebuffer_config = NULL;
+ {
+ int glx_attribs[64];
+ int fbcount = 0;
- GHOST_X11_GL_GetAttributes(glx_attribs, 64, m_numOfAASamples, m_stereoVisual, true);
+ GHOST_X11_GL_GetAttributes(glx_attribs, 64, m_numOfAASamples, m_stereoVisual, false, true);
- framebuffer_config = glXChooseFBConfig(m_display, DefaultScreen(m_display), glx_attribs, &fbcount);
- }
+ framebuffer_config = glXChooseFBConfig(m_display, DefaultScreen(m_display), glx_attribs, &fbcount);
+ }
- if (framebuffer_config) {
- m_context = glXCreateContextAttribsARB(m_display, framebuffer_config[0], s_sharedContext, True, attribs);
- XFree(framebuffer_config);
+ if (framebuffer_config) {
+ m_context = glXCreateContextAttribsARB(m_display, framebuffer_config[0], s_sharedContext, True, attribs);
+ XFree(framebuffer_config);
+ }
}
}
else {
@@ -401,16 +408,11 @@ GHOST_TSuccess GHOST_ContextGLX::getSwapInterval(int &intervalOut)
int GHOST_X11_GL_GetAttributes(
int *attribs, int attribs_max,
int samples, bool is_stereo_visual,
+ bool need_alpha,
bool for_fb_config)
{
int i = 0;
-#ifdef GHOST_OPENGL_ALPHA
- const bool need_alpha = true;
-#else
- const bool need_alpha = false;
-#endif
-
#ifdef GHOST_OPENGL_STENCIL
const bool need_stencil = true;
#else