CGLContextObj context;
};
+static const char *gl_3_2_check_funcs[] =
+{
+ "glGenTransformFeedbacks",
+ "glBindTransformFeedback",
+ "glPauseTransformFeedback",
+ "glResumeTransformFeedback",
+ "glDeleteTransformFeedbacks",
+ "glVertexAttribDivisor"
+};
+
static bool vigs_gl_backend_cgl_check_gl_version(struct vigs_gl_backend_cgl *gl_backend_cgl,
bool *is_gl_2)
{
const char *tmp;
CGLPixelFormatObj pixel_format;
int n;
+ unsigned int i;
tmp = getenv("GL_VERSION");
CGLDestroyPixelFormat(pixel_format);
+ for (i = 0;
+ i < sizeof(gl_3_2_check_funcs)/sizeof(gl_3_2_check_funcs[0]);
+ ++i) {
+ if (!dlsym(gl_backend_cgl->handle,
+ gl_3_2_check_funcs[i])) {
+ VIGS_LOG_INFO("Failed to find function \"%s\", using OpenGL 2.1",
+ gl_3_2_check_funcs[i]);
+ *is_gl_2 = true;
+ res = true;
+ goto out;
+ }
+ }
+
VIGS_LOG_INFO("Using OpenGL 3.2");
*is_gl_2 = false;
res = true;
bool is_3_2_core;
};
+static const char *gl_3_2_check_funcs[] =
+{
+ "glGenTransformFeedbacks",
+ "glBindTransformFeedback",
+ "glPauseTransformFeedback",
+ "glResumeTransformFeedback",
+ "glDeleteTransformFeedbacks",
+ "glVertexAttribDivisor"
+};
+
static bool yagl_egl_cgl_get_gl_version(struct yagl_egl_cgl *egl_cgl,
yagl_gl_version *version)
{
const char *tmp;
CGLPixelFormatObj pixel_format;
int n;
+ unsigned int i;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_get_gl_version, NULL);
CGLDestroyPixelFormat(pixel_format);
+ for (i = 0;
+ i < sizeof(gl_3_2_check_funcs)/sizeof(gl_3_2_check_funcs[0]);
+ ++i) {
+ if (!yagl_dyn_lib_get_sym(egl_cgl->base.dyn_lib,
+ gl_3_2_check_funcs[i])) {
+ YAGL_LOG_INFO("Failed to find function \"%s\", using OpenGL 2.1",
+ gl_3_2_check_funcs[i]);
+ *version = yagl_gl_2;
+ res = true;
+ goto out;
+ }
+ }
+
YAGL_LOG_INFO("Using OpenGL 3.2");
*version = yagl_gl_3_2;
res = true;