X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fglx%2Fglcontext.cpp;h=3ee8865d7559e0890df797cb79ef893097f50847;hb=4727c8ca14f2d278a74e0abe64b7a31e68238a8a;hp=5f04e3b2fd51e21afbc1c03eac252623df16e1d7;hpb=018da17591533b034d6bf018d2a9ac640007575e;p=libs%2Fgui.git diff --git a/source/graphics/glx/glcontext.cpp b/source/graphics/glx/glcontext.cpp index 5f04e3b..3ee8865 100644 --- a/source/graphics/glx/glcontext.cpp +++ b/source/graphics/glx/glcontext.cpp @@ -114,6 +114,12 @@ void GLContext::platform_init(const GLOptions &opts) ctx_attribs.push_back(GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB); } + if(opts.core_profile) + { + ctx_attribs.push_back(GLX_CONTEXT_PROFILE_MASK_ARB); + ctx_attribs.push_back(GLX_CONTEXT_CORE_PROFILE_BIT_ARB); + } + if(opts.gl_version_major) { ctx_attribs.push_back(GLX_CONTEXT_MAJOR_VERSION_ARB); @@ -211,10 +217,10 @@ GLContext::~GLContext() void GLContext::set_swap_interval(unsigned i) { const GLubyte *name = reinterpret_cast("glXSwapIntervalEXT"); - PFNGLXSWAPINTERVALEXTPROC func = reinterpret_cast(glXGetProcAddress(name)); - if(!func) + PFNGLXSWAPINTERVALEXTPROC glXSwapInterval = reinterpret_cast(glXGetProcAddress(name)); + if(!glXSwapInterval) throw runtime_error("glXSwapIntervalEXT not found"); - func(display.get_private().display, (priv->glxwnd ? priv->glxwnd : priv->subwnd), i); + glXSwapInterval(display.get_private().display, (priv->glxwnd ? priv->glxwnd : priv->subwnd), i); } void GLContext::swap_buffers()