summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-03-24 11:51:06 +0000
committerJose Fonseca <jfonseca@vmware.com>2015-03-24 21:17:40 +0000
commite49f571ae0de14bb79e8d3b98ad33293b00b12a9 (patch)
treeaeec0030d1af977ae981baa5d21f7a91db9cd8e7
parent7125e8f6e39c0eccb89623bbb1e7917a4d91875a (diff)
framework: Use GLUT_3_2_CORE_PROFILE on MacOSX.
Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/util/piglit-framework-gl/piglit_glut_framework.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c
index 777d20e39..71c640aba 100644
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c
@@ -127,12 +127,31 @@ init_glut(void)
else
flags |= GLUT_SINGLE;
+ /*
+ * MacOSX GLUT.
+ *
+ * This will request a core profile. It will always return the highest
+ * version supported.
+ *
+ * See:
+ * /System/Library/Frameworks/GLUT.framework/Headers/glut.h
+ * https://developer.apple.com/opengl/capabilities/
+ */
+#if GLUT_MACOSX_IMPLEMENTATION >= 4
+ if (test_config->supports_gl_core_version >= 31) {
+ flags |= GLUT_3_2_CORE_PROFILE;
+ }
+#endif
+
glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(test_config->window_width,
test_config->window_height);
glutInitDisplayMode(flags);
+ /*
+ * FreeGLUT
+ */
#ifdef PIGLIT_USE_GLUT_INIT_ERROR_FUNC
glutInitErrorFunc(error_func);
#else
@@ -275,7 +294,8 @@ piglit_glut_framework_create(const struct piglit_gl_test_config *test_config)
{
bool ok = true;
-#ifndef GLUT_CORE_PROFILE
+#if !defined(GLUT_CORE_PROFILE) && \
+ (!defined(GLUT_MACOSX_IMPLEMENTATION) || GLUT_MACOSX_IMPLEMENTATION < 4)
if (!test_config->supports_gl_compat_version) {
printf("GLUT can create only GL compatibility contexts, "
"which the test does not support running under.\n");