summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Bieler <fabianbieler@fastmail.fm>2014-02-05 22:07:52 +0100
committerKenneth Graunke <kenneth@whitecape.org>2014-03-08 02:09:12 -0800
commitf827282a995db88f76666649cdd43b0a3cbc008f (patch)
treeb6d54ae2c259e6011ebfe3c2d6f9b8885596df69
parent47a89ea50bf285e9da4e86da75d53f5634650fbf (diff)
downloadmesa-demos-f827282a995db88f76666649cdd43b0a3cbc008f.zip
mesa-demos-f827282a995db88f76666649cdd43b0a3cbc008f.tar.xz
geom-outlining-150: Switch to core profile.
Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/glsl/geom-outlining-150.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/geom-outlining-150.c b/src/glsl/geom-outlining-150.c
index 3dffa16..2e2a54a 100644
--- a/src/glsl/geom-outlining-150.c
+++ b/src/glsl/geom-outlining-150.c
@@ -364,9 +364,22 @@ main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowSize(WinWidth, WinHeight);
+#ifdef HAVE_FREEGLUT
+ glutInitContextVersion(3, 2);
+ glutInitContextProfile(GLUT_CORE_PROFILE);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
+#elif defined __APPLE__
+ glutInitDisplayMode(GLUT_3_2_CORE_PROFILE | GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
+#else
+ glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
+#endif
Win = glutCreateWindow(argv[0]);
+ /* glewInit requires glewExperimentel set to true for core profiles.
+ * Depending on the glew version it also generates a GL_INVALID_ENUM.
+ */
+ glewExperimental = GL_TRUE;
glewInit();
+ glGetError();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);