diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-03 11:39:31 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-03 11:39:31 -0800 |
commit | 519efb8e48baa01d4af89cb66dc060da18e439b2 (patch) | |
tree | 125eac0cb976ceb9c5fa3c19249c2472a22f95eb /tests | |
parent | 5528ef9f827a475d71574b56783f8d4d07637f60 (diff) |
properly handle getParameter returning null when it means a null object (e.g., no buffer is bound) and not an invalid name
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cubegeom.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/cubegeom.c b/tests/cubegeom.c index 96d56339..e749045b 100644 --- a/tests/cubegeom.c +++ b/tests/cubegeom.c @@ -54,9 +54,21 @@ int main(int argc, char *argv[]) // Create a texture + GLuint boundTex = 123; + assert(!glGetError()); + glGetIntegerv(GL_TEXTURE_BINDING_2D, &boundTex); + assert(!glGetError()); + assert(boundTex == 0); + GLuint texture; glGenTextures( 1, &texture ); glBindTexture( GL_TEXTURE_2D, texture ); + + assert(!glGetError()); + glGetIntegerv(GL_TEXTURE_BINDING_2D, &boundTex); + assert(!glGetError()); + assert(boundTex == 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]; |