/* gcc -Wall -Wextra -g3 -lglut -lGL texstorage_fail.c -o texstorage_fail */ #define GL_GLEXT_PROTOTYPES #include #include #include #include #include int main(int argc, char* argv[]) { GLuint tex; glutInitDisplayMode( GLUT_RGBA ); glutInit( &argc, argv ); glutCreateWindow( "glTexStorage*() with proxy textures" ); glTexStorage2D( GL_PROXY_TEXTURE_2D , 8 /* 8 mipmap levels */ , GL_RGBA8 , 128 , 128 ); /* should not fail, but it does. Triggers the error with mipmaps. */ if ( glGetError() != GL_NO_ERROR ) { fprintf( stderr, "failure 1\n" ); } glTexStorage2D( GL_PROXY_TEXTURE_2D , 1 /* reducing the number of mipmaps to 1 */ , GL_RGBA8 , 128 , 128 ); /* now it should fail the check of having no texture bound */ if ( glGetError() != GL_NO_ERROR ) { fprintf( stderr, "failure 2\n" ); } return 0; }