How to create OpenGL ES 2 context on Desktop?

Manmohan Bishnoi

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:

https://github.com/manmohanbishnoi/my-experiments/blob/master/OpenGL%20ES%20context%20on%20Desktop/opengl_es2.c

derhass

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 the GLX_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 with GLX_CONTEXT_ES_PROFILE_BIT_EXT and the extension name GLX_EXT_create_context_es2_profile with GLX_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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create EGL context on NVidia Desktop

From Dev

How to detect is opengl ruunning on Desktop or ES

From Dev

How to detect is opengl ruunning on Desktop or ES

From Dev

Why can't I create an OpenGL ES 3.0 context using SDL2?

From Dev

How to create opengl context via drm (Linux)

From Dev

How to create a second OpenGL context for multithreading on linux?

From Dev

Dota 2 Failed to create OpenGL context on Acer Aspire 4741

From Dev

How can I create a desktop icon with a custom context menu

From Dev

How do I create an OpenGL 1.2 context in GLFW 3

From Dev

How to create an OpenGL 3.3 or 4.x context through EGL

From Dev

How do I create an OpenGL 1.2 context in GLFW 3

From Dev

How to create a VAO in openGL ES 3 android

From Dev

Create stereo context for modern opengl

From Dev

OpenGL ES 2.0 Context in Android

From Dev

OPENGL ES not working : no Current context

From Dev

GLSurfaceView with OpenGL ES 3.1 context

From Dev

OPENGL ES not working : no Current context

From Dev

How to zoom properly in OpenGL ES 2

From Dev

OpenGL ES 2 on Android: how to use VBOs

From Dev

How to deal with multiple objects in OpenGL ES 2

From Dev

OpenGL ES 2 on Android: how to use VBOs

From Dev

How to copy a texture in a OpenGL context to another context

From Dev

How to copy a texture in a OpenGL context to another context

From Dev

SDL2 on Raspberry Pi can't create renderer: "OpenGL context already created"

From Dev

Android NDK C++ openGL ES 2 context gives bad display

From Dev

How to create a ".desktop" file?

From Dev

How to create a ".desktop" file?

From Dev

How do I create an OpenGL 3.2 context in Go on MacOS (Lion-10.8)

From Dev

how can I create OpenGL context using Windows memory dc (c++)

Related Related

  1. 1

    How to create EGL context on NVidia Desktop

  2. 2

    How to detect is opengl ruunning on Desktop or ES

  3. 3

    How to detect is opengl ruunning on Desktop or ES

  4. 4

    Why can't I create an OpenGL ES 3.0 context using SDL2?

  5. 5

    How to create opengl context via drm (Linux)

  6. 6

    How to create a second OpenGL context for multithreading on linux?

  7. 7

    Dota 2 Failed to create OpenGL context on Acer Aspire 4741

  8. 8

    How can I create a desktop icon with a custom context menu

  9. 9

    How do I create an OpenGL 1.2 context in GLFW 3

  10. 10

    How to create an OpenGL 3.3 or 4.x context through EGL

  11. 11

    How do I create an OpenGL 1.2 context in GLFW 3

  12. 12

    How to create a VAO in openGL ES 3 android

  13. 13

    Create stereo context for modern opengl

  14. 14

    OpenGL ES 2.0 Context in Android

  15. 15

    OPENGL ES not working : no Current context

  16. 16

    GLSurfaceView with OpenGL ES 3.1 context

  17. 17

    OPENGL ES not working : no Current context

  18. 18

    How to zoom properly in OpenGL ES 2

  19. 19

    OpenGL ES 2 on Android: how to use VBOs

  20. 20

    How to deal with multiple objects in OpenGL ES 2

  21. 21

    OpenGL ES 2 on Android: how to use VBOs

  22. 22

    How to copy a texture in a OpenGL context to another context

  23. 23

    How to copy a texture in a OpenGL context to another context

  24. 24

    SDL2 on Raspberry Pi can't create renderer: "OpenGL context already created"

  25. 25

    Android NDK C++ openGL ES 2 context gives bad display

  26. 26

    How to create a ".desktop" file?

  27. 27

    How to create a ".desktop" file?

  28. 28

    How do I create an OpenGL 3.2 context in Go on MacOS (Lion-10.8)

  29. 29

    how can I create OpenGL context using Windows memory dc (c++)

HotTag

Archive