diff options
author | Brian Paul <[email protected]> | 2004-01-31 19:57:25 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-01-31 19:57:25 +0000 |
commit | c9e1c8098b40e28a1273b2846972f2434076156b (patch) | |
tree | e442b771a66c213d8a97742d8105f81918794f87 /progs/tests | |
parent | 1e71d2af5ee64d2eec4e2e4bad044d662ee5f066 (diff) |
added display list option (l key)
Diffstat (limited to 'progs/tests')
-rw-r--r-- | progs/tests/vparray.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/progs/tests/vparray.c b/progs/tests/vparray.c index 1c513cf0f41..580a670f8e1 100644 --- a/progs/tests/vparray.c +++ b/progs/tests/vparray.c @@ -23,6 +23,7 @@ static GLfloat xrot; static GLfloat yrot; static GLboolean useArrays = GL_TRUE; static GLboolean useProgram = GL_TRUE; +static GLboolean useList = GL_FALSE; static void read_surface( char *filename ) @@ -79,7 +80,16 @@ static void Display(void) glEnableClientState( GL_NORMAL_ARRAY ); } - glDrawArrays(GL_TRIANGLE_STRIP, 0, numverts); + if (useList) { + /* dumb, but a good test */ + glNewList(1,GL_COMPILE); + glDrawArrays(GL_TRIANGLE_STRIP, 0, numverts); + glEndList(); + glCallList(1); + } + else { + glDrawArrays(GL_TRIANGLE_STRIP, 0, numverts); + } glDisableClientState( GL_VERTEX_ATTRIB_ARRAY0_NV ); glDisableClientState( GL_VERTEX_ATTRIB_ARRAY2_NV); @@ -225,6 +235,10 @@ static void Key( unsigned char key, int x, int y ) useArrays = !useArrays; printf("use arrays: %s\n", useArrays ? "yes" : "no"); break; + case 'l': + useList = !useList; + printf("use list: %s\n", useList ? "yes" : "no"); + break; case 'p': useProgram = !useProgram; printf("use program: %s\n", useProgram ? "yes" : "no"); |