Is it possible to create OpenGL ES 2 context on desktop linux?
My context related code is like this:
int context_attribs[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
GLX_CONTEXT_MINOR_VERSION_ARB, 5,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
None
};
ctx = glXCreateContextAttribsARB( display, bestFbc, 0,
True, context_attribs );
But it fails.
However this succeeds:
int context_attribs[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
GLX_CONTEXT_MINOR_VERSION_ARB, 5,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
None
};
What am I doing wrong here?
I am trying to do this on Fedora 22 x86_64 with NVIDIA GTX 750 Ti GPU.
UPDATE
Here's the working code to create OpenGL ES 2.0 context based on answer below:
You are requesting an OpenGL ES version 4.5 context, which does not exist. From the GLX_EXT_create_context_es2_profile
extension spec:
If the version requested is a valid and supported OpenGL-ES version, and the
GLX_CONTEXT_ES_PROFILE_BIT_EXT
bit is set in theGLX_CONTEXT_PROFILE_MASK_ARB
attribute (see below), then the context returned will implement the OpenGL ES version requested.
The GLX_CONTEXT_ES2_PROFILE_BIT_EXT
is actually kind of a red herring:
Version 3, 2012/03/28
- Add support for any OpenGL-ES version, not just version 2.0. Alias
GLX_CONTEXT_ES2_PROFILE_BIT_EXT
withGLX_CONTEXT_ES_PROFILE_BIT_EXT
and the extension nameGLX_EXT_create_context_es2_profile
withGLX_EXT_create_context_es_profile
.
So it doesn't select a version at all in a profile, version and profile are working orthogonally...
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments