summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2007-07-17 03:29:13 +0000
committerpixel <pixel>2007-07-17 03:29:13 +0000
commit09147e9d4d10f609a7f288b35fa7f86b7e011e8a (patch)
tree7bbb73a01348b71c806c664d126c652d5f75030f
parent0ce03af6e877adebeda12787e249871c1fca43f2 (diff)
Adding DDS initialisation.
-rw-r--r--include/dds.h2
-rw-r--r--lib/dds.c24
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 );
diff --git a/lib/dds.c b/lib/dds.c
index 82684d5..4263bf0 100644
--- a/lib/dds.c
+++ b/lib/dds.c
@@ -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;
+}