Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose epoxy_extension_in_string() in public headers #136

Merged
merged 1 commit into from
Oct 19, 2017

Conversation

Lyude
Copy link
Contributor

@Lyude Lyude commented Aug 24, 2017

The EGL_EXT_device_query extension introduces the
eglQueryDeviceStringEXT() function, which can be used with an
EGLDeviceEXT enumeration to receive an OpenGL extension string
containing all of the device extensions supported by it. From the
EGL_EXT_device_query spec's amendments to section "3.2 Devices" after
"3.1 Errors":

const char *eglQueryDeviceStringEXT(EGLDeviceEXT device,
				    EGLint name);

returns a pointer to a static, zero-terminated string describing
some aspect of the specified EGLDeviceEXT.  <name> must be
EGL_EXTENSIONS.

Since OpenGL extension parsing is rather simple, and we could always run
into additional cases similar to this one in the future, we expose the
shared epoxy_extension_in_string() function in libepoxy's public headers
so that users can save themselves the hassle of having to write their
own extension parser.

Signed-off-by: Lyude Paul thatslyude@gmail.com

The EGL_EXT_device_query extension introduces the
eglQueryDeviceStringEXT() function, which can be used with an
EGLDeviceEXT enumeration to receive an OpenGL extension string
containing all of the device extensions supported by it. From the
EGL_EXT_device_query spec's amendments to section "3.2 Devices" after
"3.1 Errors":

    const char *eglQueryDeviceStringEXT(EGLDeviceEXT device,
    				    EGLint name);

    returns a pointer to a static, zero-terminated string describing
    some aspect of the specified EGLDeviceEXT.  <name> must be
    EGL_EXTENSIONS.

Since OpenGL extension parsing is rather simple, and we could always run
into additional cases similar to this one in the future, we expose the
shared epoxy_extension_in_string() function in libepoxy's public headers
so that users can save themselves the hassle of having to write their
own extension parser.

Signed-off-by: Lyude Paul <thatslyude@gmail.com>
@ebassi
Copy link
Collaborator

ebassi commented Oct 18, 2017

How would this differ from epoxy_has_egl_extension()? Outside of the marginal performance win of getting the static string once, I mean…

@nwnk
Copy link
Collaborator

nwnk commented Oct 18, 2017

epoxy_has_egl_extension parses either the extension string of the display or of no display (effectively, of the client library). eglQueryDeviceStringEXT adds another kind of extension string, hanging off a different object, a device.

@Lyude
Copy link
Contributor Author

Lyude commented Oct 18, 2017

Yep, that's the gist of it. There aren't really any performance reasons for this; I just figured if we've already got library helpers for the rest of the GL/EGL/etc. APIs we might as well have one for edge cases in the spec like this.

@ebassi
Copy link
Collaborator

ebassi commented Oct 19, 2017

Sounds fair, then.

@ebassi ebassi merged commit 1b54e26 into anholt:master Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants