commit 4f4528290bcf47cac3d5fd6927e0d8c6ba86f37f
parent fc4b50354ab61e4881c6565d9d3d27d5a6a1e56b
Author: Brian Swetland <swetland@frotz.net>
Date: Wed, 28 Aug 2013 23:07:43 -0700
linux/intel: tests run on hd4000 w/ mesa 9.1.x now
- Try for a GL 3.3 context, but allow 3.2 or 3.1
- TODO: ensure necessary extensions exist if we reduce version
- shaders only require GLSL 1.4
Diffstat:
4 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/common/assets/textgrid.glsl b/common/assets/textgrid.glsl
@@ -1,4 +1,4 @@
-#version 150
+#version 140
#extension GL_ARB_explicit_attrib_location : enable
-- vertex
diff --git a/common/glapp.cc b/common/glapp.cc
@@ -116,20 +116,22 @@ int App::start(void) {
// | SDL_WINDOW_FULLSCREEN
);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
-
- glcontext = SDL_GL_CreateContext(win);
-
-#if FALLBACK_TO_GL32
- if (!glcontext) {
- fprintf(stderr, "oops?\n");
+ int minor = 3;
+ while (minor > 0) {
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minor);
glcontext = SDL_GL_CreateContext(win);
- /* query needed extensions, etc */
+ if (glcontext)
+ break;
+ minor--;
+ }
+ if (!glcontext) {
+ fprintf(stderr,"cannot obtain OpenGL 3.1+ context\n");
+ exit(1);
+ } else {
+ fprintf(stderr,"using OpenGL 3.%d\n", minor);
+ /* todo: verify extension availability */
}
-#endif
SDL_GL_SetSwapInterval(_vsync);
diff --git a/hello/assets/simple.glsl b/hello/assets/simple.glsl
@@ -1,4 +1,4 @@
-#version 150
+#version 140
#extension GL_ARB_explicit_attrib_location : enable
-- vertex
diff --git a/test/assets/simple.glsl b/test/assets/simple.glsl
@@ -1,4 +1,4 @@
-#version 150
+#version 140
#extension GL_ARB_explicit_attrib_location : enable
-- vertex