aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-14 10:28:17 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-14 10:28:17 -0700
commit21b34fed2da3e0b9f69e9a4fe038ebf1b47dfa7c (patch)
tree5a9295e066a0061aaa7de7dfe8ac8098283ffadc /tests
parent040c61cbbe74717e8c797a0ef92144528e864faf (diff)
support for GL_TRIANGLE_STRIP
Diffstat (limited to 'tests')
-rw-r--r--tests/screenshot-gray.pngbin170477 -> 203336 bytes
-rw-r--r--tests/sdl_ogl.c31
2 files changed, 16 insertions, 15 deletions
diff --git a/tests/screenshot-gray.png b/tests/screenshot-gray.png
index 928f9f9a..16e45a7a 100644
--- a/tests/screenshot-gray.png
+++ b/tests/screenshot-gray.png
Binary files differ
diff --git a/tests/sdl_ogl.c b/tests/sdl_ogl.c
index cec32bf1..c423a16e 100644
--- a/tests/sdl_ogl.c
+++ b/tests/sdl_ogl.c
@@ -119,21 +119,22 @@ int main(int argc, char *argv[])
glBindTexture( GL_TEXTURE_2D, texture );
glBegin( GL_QUADS );
- // Top-left vertex (corner)
- glTexCoord2i( 0, 0 );
- glVertex3f( 100, 100, 0 );
-
- // Bottom-left vertex (corner)
- glTexCoord2i( 1, 0 );
- glVertex3f( 600, 100, 0 );
-
- // Bottom-right vertex (corner)
- glTexCoord2i( 1, 1 );
- glVertex3f( 600, 328, 0 );
-
- // Top-right vertex (corner)
- glTexCoord2i( 0, 1 );
- glVertex3f( 100, 328, 0 );
+ glTexCoord2i( 0, 0 ); glVertex3f( 10, 10, 0 );
+ glTexCoord2i( 1, 0 ); glVertex3f( 300, 10, 0 );
+ glTexCoord2i( 1, 1 ); glVertex3f( 300, 128, 0 );
+ glTexCoord2i( 0, 1 ); glVertex3f( 10, 128, 0 );
+
+ glTexCoord2f( 0, 0.5 ); glVertex3f( 410, 10, 0 );
+ glTexCoord2f( 1, 0.5 ); glVertex3f( 600, 10, 0 );
+ glTexCoord2f( 1, 1 ); glVertex3f( 630, 200, 0 );
+ glTexCoord2f( 0.5, 1 ); glVertex3f( 310, 250, 0 );
+ glEnd();
+
+ glBegin( GL_TRIANGLE_STRIP );
+ glTexCoord2i( 0, 0 ); glVertex3f( 100, 300, 0 );
+ glTexCoord2i( 1, 0 ); glVertex3f( 300, 300, 0 );
+ glTexCoord2i( 1, 1 ); glVertex3f( 300, 400, 0 );
+ glTexCoord2i( 0, 1 ); glVertex3f( 500, 410, 0 );
glEnd();
SDL_GL_SwapBuffers();