Skip to content

Commit

Permalink
Merge pull request #136 from Lyude/pull/epoxy_ext_in_str
Browse files Browse the repository at this point in the history
Expose epoxy_extension_in_string() in public headers
  • Loading branch information
ebassi committed Oct 19, 2017
2 parents 1dc283e + 4bde48e commit 1b54e26
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions include/epoxy/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ typedef unsigned char bool;
# include <stdbool.h>
#endif

EPOXY_BEGIN_DECLS

EPOXY_PUBLIC bool epoxy_extension_in_string(const char *extension_list,
const char *ext);

EPOXY_END_DECLS

#endif /* EPOXY_COMMON_H */
18 changes: 18 additions & 0 deletions src/dispatch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,24 @@ epoxy_conservative_gl_version(void)
return epoxy_internal_gl_version(100);
}

/**
* @brief Checks for the presence of an extension in an OpenGL extension string
*
* @param extension_list The string containing the list of extensions to check
* @param ext The name of the GL extension
* @return `true` if the extension is available'
*
* @note If you are looking to check whether a normal GL, EGL or GLX extension
* is supported by the client, this probably isn't the function you want.
*
* Some parts of the spec for OpenGL and friends will return an OpenGL formatted
* extension string that is seperate from the usual extension strings for the
* spec. This function provides easy parsing of those strings.
*
* @see epoxy_has_gl_extension()
* @see epoxy_has_egl_extension()
* @see epoxy_has_glx_extension()
*/
bool
epoxy_extension_in_string(const char *extension_list, const char *ext)
{
Expand Down
2 changes: 0 additions & 2 deletions src/dispatch_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ bool epoxy_conservative_has_wgl_extension(const char *name);
void *epoxy_conservative_egl_dlsym(const char *name, bool exit_if_fails);
void *epoxy_conservative_glx_dlsym(const char *name, bool exit_if_fails);

bool epoxy_extension_in_string(const char *extension_list, const char *ext);

#define glBegin_unwrapped epoxy_glBegin_unwrapped
#define glEnd_unwrapped epoxy_glEnd_unwrapped
extern void UNWRAPPED_PROTO(glBegin_unwrapped)(GLenum primtype);
Expand Down

0 comments on commit 1b54e26

Please sign in to comment.