else
glamor_priv->gl_flavor = GLAMOR_GL_ES2;
- gl_version = glamor_gl_get_version();
+ gl_version = epoxy_gl_version();
/* We'd like to require GL_ARB_map_buffer_range or
* GL_OES_map_buffer_range, since it offers more information to
* Windows with Intel 4-series (G45) graphics or older.
*/
if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
- if (gl_version < GLAMOR_GL_VERSION_ENCODE(1, 3)) {
+ if (gl_version < 13) {
ErrorF("Require OpenGL version 1.3 or later.\n");
goto fail;
}
} else {
- if (gl_version < GLAMOR_GL_VERSION_ENCODE(2, 0)) {
+ if (gl_version < 20) {
ErrorF("Require Open GLES2.0 or later.\n");
goto fail;
}
return ret;
}
-int
-glamor_gl_get_version(void)
-{
- int major, minor;
- const char *version = (const char *) glGetString(GL_VERSION);
- const char *dot = version == NULL ? NULL : strchr(version, '.');
- const char *major_start = dot;
-
- /* Sanity check */
- if (dot == NULL || dot == version || *(dot + 1) == '\0') {
- major = 0;
- minor = 0;
- }
- else {
- /* Find the start of the major version in the string */
- while (major_start > version && *major_start != ' ')
- --major_start;
- major = strtol(major_start, NULL, 10);
- minor = strtol(dot + 1, NULL, 10);
- }
-
- return GLAMOR_GL_VERSION_ENCODE(major, minor);
-}
Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask);
Bool glamor_change_window_attributes(WindowPtr pWin, unsigned long mask);
RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap);
-int glamor_gl_get_version(void);
-
-#define GLAMOR_GL_VERSION_ENCODE(major, minor) ( \
- ((major) * 256) \
- + ((minor) * 1))
/* glamor_fill.c */
Bool glamor_fill(DrawablePtr drawable,