mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 18:20:30 +01:00
Create OpenGL context using CreateContextAttribsARB
This commit is contained in:
parent
09b8837ef9
commit
d59bcdbd07
@ -319,6 +319,28 @@ bool CGLXManager::generateContext()
|
|||||||
{
|
{
|
||||||
if (GlxWin)
|
if (GlxWin)
|
||||||
{
|
{
|
||||||
|
#if defined(GLX_ARB_create_context)
|
||||||
|
|
||||||
|
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||||
|
PFNGLXCREATECONTEXTATTRIBSARBPROC glxCreateContextAttribsARB=(PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB"));
|
||||||
|
#else
|
||||||
|
PFNGLXCREATECONTEXTATTRIBSARBPROC glxCreateContextAttribsARB=glXCreateContextAttribsARB;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (glxCreateContextAttribsARB)
|
||||||
|
{
|
||||||
|
int contextAttrBuffer[] = {
|
||||||
|
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
|
||||||
|
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
|
||||||
|
// GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
|
||||||
|
None
|
||||||
|
};
|
||||||
|
context = glxCreateContextAttribsARB((Display*)CurrentContext.OpenGLLinux.X11Display, (GLXFBConfig)glxFBConfig, NULL, True, contextAttrBuffer);
|
||||||
|
// transparently fall back to legacy call
|
||||||
|
}
|
||||||
|
if (!context)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
// create glx context
|
// create glx context
|
||||||
context = glXCreateNewContext((Display*)CurrentContext.OpenGLLinux.X11Display, (GLXFBConfig)glxFBConfig, GLX_RGBA_TYPE, NULL, True);
|
context = glXCreateNewContext((Display*)CurrentContext.OpenGLLinux.X11Display, (GLXFBConfig)glxFBConfig, GLX_RGBA_TYPE, NULL, True);
|
||||||
if (!context)
|
if (!context)
|
||||||
@ -327,6 +349,7 @@ bool CGLXManager::generateContext()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
os::Printer::log("GLX window was not properly created.", ELL_WARNING);
|
os::Printer::log("GLX window was not properly created.", ELL_WARNING);
|
||||||
|
Loading…
Reference in New Issue
Block a user