#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
# include <dlfcn.h>
#endif
-#include <GL/gl.h>
+#include <simgear/compiler.h>
+
+#include SG_GL_H
#if defined(__cplusplus)
#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))()
#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
}
* 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 */