diff options
author | Brian Paul <brianp@vmware.com> | 2010-07-15 08:00:52 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-07-15 08:00:52 -0600 |
commit | 28ca3c1c92da57851eff53aba90f1872f24cdb01 (patch) | |
tree | 27e7b70dbf6b5d796f415f97689a1e1764ddda79 | |
parent | be58f75d6843ded9fae69dad57eb771ea3fc1d11 (diff) |
primitive-restart: add compile-time tests for GL 3.1
-rw-r--r-- | tests/general/primitive-restart.c | 16 |
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 |