[Mesa-dev] [PATCH 12/12] geom-outlining-150: Switch to core profile.

Fabian Bieler fabianbieler at fastmail.fm
Wed Feb 19 15:17:13 PST 2014


Signed-off-by: Fabian Bieler <fabianbieler at fastmail.fm>
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/geom-outlining-150.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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);
-- 
1.8.3.2



More information about the mesa-dev mailing list