diff options
-rw-r--r-- | include/dds.h | 2 | ||||
-rw-r--r-- | lib/dds.c | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/include/dds.h b/include/dds.h index 05911d2..5a0352e 100644 --- a/include/dds.h +++ b/include/dds.h @@ -1,6 +1,8 @@ #ifndef __DDS_H__ #define __DDS_H__ +int ddsInit(); + // returns the OpenGL-generated texture index. int loadCompressedTexture( const char *fname ); @@ -296,3 +296,27 @@ int loadCompressedTexture( const char *fname ) return g_compressedTextureID; } + +int ddsInit() { + char *ext = (char*)glGetString( GL_EXTENSIONS ); + + if( strstr( ext, "ARB_texture_compression" ) == NULL ) + { +// MessageBox(NULL,"ARB_texture_compression extension was not found", +// "ERROR",MB_OK|MB_ICONEXCLAMATION); + return -1; + } + else + { + glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glxGetProcAddress("glCompressedTexImage2DARB"); + + if( !glCompressedTexImage2DARB ) + { +// MessageBox(NULL,"One or more ARB_texture_compression functions were not found", +// "ERROR",MB_OK|MB_ICONEXCLAMATION); + return -2; + } + } + + return 0; +} |