]> git.mxchange.org Git - simgear.git/blobdiff - simgear/screen/extensions.hxx
Add a function to calculate the normalmap from a regular texture.
[simgear.git] / simgear / screen / extensions.hxx
index b6856a77a782db00a0eee96dc3b9cd1ad17c074d..4b9046a0c1e6316996d260cef51190924b5670de 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __SG_EXTENSIONS_HXX
 #define __SG_EXTENSIONS_HXX 1
 
-#if defined(__CYGWIN__)  /* && !defined(USING_X) */
+#if defined(__CYGWIN__) && !defined(WIN32) /* && !defined(USING_X) */
 #define WIN32
 #endif
 
@@ -36,7 +36,9 @@
 # include <dlfcn.h>
 #endif
 
-#include <GL/gl.h>
+#include <simgear/compiler.h>
+
+#include SG_GL_H
 
 
 #if defined(__cplusplus)
@@ -53,6 +55,11 @@ bool SGIsOpenGLExtensionSupported(char *extName);
 #ifdef __APPLE__
   // don't use an inline function for symbol lookup, since it is too big
   void* macosxGetGLProcAddress(const char *func);
+
+#elif !defined( WIN32 )
+
+  void *SGGetGLProcAddress(const char *func);
+  
 #endif
 
 inline void (*SGLookupFunction(const char *func))()
@@ -65,16 +72,7 @@ inline void (*SGLookupFunction(const char *func))()
 
 #else // UNIX
 
-    // If the target system s UNIX and the ARB_get_proc_address
-    // GLX extension is *not* guaranteed to be supported. An alternative
-    // dlsym-based approach will be used instead.
-
-    void *libHandle;
-    void (*fptr)();
-    libHandle = dlopen("libGL.so", RTLD_LAZY);
-    fptr = (void (*)()) dlsym(libHandle, func);
-    dlclose(libHandle);
-    return fptr;
+    return (void (*)()) SGGetGLProcAddress(func);
 #endif
 }
 
@@ -82,13 +80,24 @@ inline void (*SGLookupFunction(const char *func))()
  * OpenGL 1.2 and 1.3 enumerants
  */
 
-#ifndef GL_CLAMP_TO_EDGE
+#ifndef GL_VERSION_1_2
 #define GL_CLAMP_TO_EDGE                                        0x812F
-#endif
-
-#ifndef GL_TEXTURE_WRAP_R
 #define GL_TEXTURE_WRAP_R                                       0x8072
-#endif
+#define GL_BLEND_EQUATION                                       0x8009
+#define GL_MIN                                                  0x8007
+#define GL_MAX                                                  0x8008
+#define GL_FUNC_ADD                                             0x8006
+#define GL_FUNC_SUBTRACT                                        0x800A
+#define GL_FUNC_REVERSE_SUBTRACT                                0x800B
+#define GL_BLEND_COLOR                                          0x8005
+#define GL_CONSTANT_COLOR                                       0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR                             0x8002
+#define GL_CONSTANT_ALPHA                                       0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA                             0x8004
+#endif
+
+typedef void (APIENTRY * glBlendEquationProc) (GLenum mode );
+typedef void (APIENTRY * glBlendColorProc) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
 
 
 /* OpenGL extension declarations */