summaryrefslogtreecommitdiff
path: root/tests/general
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-07-15 08:00:52 -0600
committerBrian Paul <brianp@vmware.com>2010-07-15 08:00:52 -0600
commit28ca3c1c92da57851eff53aba90f1872f24cdb01 (patch)
tree27e7b70dbf6b5d796f415f97689a1e1764ddda79 /tests/general
parentbe58f75d6843ded9fae69dad57eb771ea3fc1d11 (diff)
primitive-restart: add compile-time tests for GL 3.1
Diffstat (limited to 'tests/general')
-rw-r--r--tests/general/primitive-restart.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/general/primitive-restart.c b/tests/general/primitive-restart.c
index 609c2de2..77ac0f04 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -256,14 +256,14 @@ test_draw_elements(GLenum primMode, GLenum indexType)
assert(glGetError()==0);
/* Setup prim restart */
if (TestGL31) {
+#ifdef GL_VERSION_3_1
glEnable(GL_PRIMITIVE_RESTART);
glPrimitiveRestartIndex(restart_index);
+#endif
}
else {
glEnableClientState(GL_PRIMITIVE_RESTART_NV);
- assert(glGetError()==0);
glPrimitiveRestartIndexNV(restart_index);
- assert(glGetError()==0);
}
/* Draw */
@@ -299,10 +299,14 @@ test_draw_elements(GLenum primMode, GLenum indexType)
}
}
- if (TestGL31)
+ if (TestGL31) {
+#ifdef GL_VERSION_3_1
glDisable(GL_PRIMITIVE_RESTART);
- else
+#endif
+ }
+ else {
glDisableClientState(GL_PRIMITIVE_RESTART_NV);
+ }
glDisableClientState(GL_VERTEX_ARRAY);
pass = check_rendering();
@@ -352,7 +356,11 @@ void
piglit_init(int argc, char **argv)
{
Have_NV = glewIsSupported("GL_NV_primitive_restart");
+#ifdef GL_VERSION_3_1
Have_31 = glewIsSupported("GL_VERSION_3_1");
+#else
+ Have_31 = GL_FALSE;
+#endif
/* Debug */
/* NOTE! glew 1.5.2's OpenGL 3.1 detection is broken. You'll need