diff options
author | José Fonseca <jfonseca@vmware.com> | 2011-08-02 22:01:41 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2011-08-02 22:01:41 +0100 |
commit | 82c3f7411bb67c94756d60a86cef8428614c3702 (patch) | |
tree | c4ef1d32c363725cb7659af3f3ee82a6cf88fc16 | |
parent | 4740962280d8906334e7e2b3096315cd3fbe1b16 (diff) |
Latest released Ubuntu only ships glew 1.5 which doesn't have the
GL_ARB_vertex_type_2_10_10_10_rev support. So replace build failure by
runtime failure in such circumstances.
-rw-r--r-- | src/trivial/tri-2101010.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/trivial/tri-2101010.c b/src/trivial/tri-2101010.c index 34b03fc4..817b260e 100644 --- a/src/trivial/tri-2101010.c +++ b/src/trivial/tri-2101010.c @@ -41,6 +41,11 @@ static void Init(void) fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); fflush(stderr); +#ifndef GL_ARB_vertex_type_2_10_10_10_rev + fprintf(stderr,"built without ARB_vertex_type_2_10_10_10_rev\n"); + exit(1); +#endif + if (!glutExtensionSupported("GL_ARB_vertex_type_2_10_10_10_rev")){ fprintf(stderr,"requires ARB_vertex_type_2_10_10_10_rev\n"); exit(1); @@ -91,6 +96,7 @@ static void Draw(void) { glClear(GL_COLOR_BUFFER_BIT); +#ifdef GL_ARB_vertex_type_2_10_10_10_rev glBegin(GL_TRIANGLES); glColorP3ui(GL_UNSIGNED_INT_2_10_10_10_REV, conv(820, 0, 0, 0)); glVertexP3ui(GL_INT_2_10_10_10_REV, iconv(-90, -90, -30, 0)); @@ -99,6 +105,7 @@ static void Draw(void) glColorP3ui(GL_UNSIGNED_INT_2_10_10_10_REV, conv(0, 0, 716, 0)); glVertexP3ui(GL_INT_2_10_10_10_REV, iconv(0, 90, -30, 0)); glEnd(); +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ glFlush(); |