aboutsummaryrefslogtreecommitdiff
path: root/tests/cube_explosion.c
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-31 17:40:41 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-31 17:40:41 -0800
commitabc177f64fddca0ce07becbfc712309377755a5f (patch)
treefe3a975e893ee13e1853252fed8ad2497510fd0e /tests/cube_explosion.c
parent375eb145c8a6c1627a8b93f81d40fd1aa7fc899b (diff)
fix glIsTexture from throwing a warning on null-ified textures, and add testing
Diffstat (limited to 'tests/cube_explosion.c')
-rw-r--r--tests/cube_explosion.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/cube_explosion.c b/tests/cube_explosion.c
index ee990a57..3f55b3c6 100644
--- a/tests/cube_explosion.c
+++ b/tests/cube_explosion.c
@@ -64,8 +64,11 @@ int main(int argc, char *argv[])
// Create a texture
GLuint texture;
+ assert(!glIsTexture(1)); // not a texture
glGenTextures( 1, &texture );
+ assert(!glIsTexture(texture)); // not a texture until glBindTexture
glBindTexture( GL_TEXTURE_2D, texture );
+ assert(glIsTexture(texture)); // NOW it is a texture
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
GLubyte textureData[16*16*4];
@@ -223,6 +226,10 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
+ assert(glIsTexture(texture)); // still a texture
+ glDeleteTextures(1, &texture);
+ assert(!glIsTexture(texture)); // but not anymore
+
verify();
#if !EMSCRIPTEN