What is the relationship between EGL and OpenGL?

后端 未结 3 1019
攒了一身酷
攒了一身酷 2020-12-24 03:04

I\'m writing an implementation for OpenVG and OpenGL|ES in Go, both of which depend on the Khronos EGL API, supposedly to ease portability I guess.

I\'m writing an

3条回答
  •  旧时难觅i
    2020-12-24 03:52

    You can bind EGL_OPENGL_API as the current API for your thread, via the eglBindAPI(EGLenum api); a subsequent eglCreateContext will create an OpenGL rendering context.

    From the EGL spec, p42:

    Some of the functions described in this section make use of the current rendering API, which is set on a per-thread basis by calling

    EGLBoolean eglBindAPI(EGLenum api);

    api must specify one of the supported client APIs , either EGL_OPENGL_API, EGL_OPENGL_ES_API, or EGL_OPENVG_API

    The caveat is that the EGL implementation is well within its rights not support EGL_OPENGL_API and instead generate an EGL_BAD_PARAMETER error if you try to bind it.

    It's also hard to link to libGL without picking up the AGL/WGL/GLX cruft; the ABI on these platforms require that libGL provides those entry points. Depending on what platform you're playing with this may or may not be a problem.

提交回复
热议问题