]> git.mxchange.org Git - simgear.git/blobdiff - simgear/screen/extensions.hxx
performance monitor: start measurement interval with a fresh timestamp.
[simgear.git] / simgear / screen / extensions.hxx
index c15269865161378f6aca17e738035c752a2fe11d..ab5a929fdde01055ae6969e9fc07bd10c1c194e1 100644 (file)
 #ifndef __SG_EXTENSIONS_HXX
 #define __SG_EXTENSIONS_HXX 1
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-# include <windows.h>
-#else
-# include <dlfcn.h>
-#endif
 
-#include <GL/gl.h>
+#include <simgear/compiler.h>
 
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-
-static bool SGSearchExtensionsString(char *extString, char *extName);
-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);
-#endif
-
-inline void (*SGLookupFunction(const char *func))()
-{
-#if defined( WIN32 ) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-    return (void (*)()) wglGetProcAddress(func);
-
-#elif defined( __APPLE__ )
-    return (void (*)()) macosxGetGLProcAddress(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;
-#endif
-}
-
-
-
-/* OpenGL extension declarations */
-#ifndef GL_EXT_point_parameters
-#define GL_POINT_SIZE_MIN_EXT                                   0x8126
-#define GL_DISTANCE_ATTENUATION_EXT                             0x8129
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_POINT_SIZE_MIN_ARB                                  0x8126
-#define GL_DISTANCE_ATTENUATION_ARB                            0x8129
-#endif
-
-typedef void (APIENTRY * glPointParameterfProc)(GLenum pname, GLfloat param);
-typedef void (APIENTRY * glPointParameterfvProc)(GLenum pname, const GLfloat *params);
-
-#if defined(__cplusplus)
-}
-#endif
+bool SGSearchExtensionsString(const char *extString, const char *extName);
+bool SGIsOpenGLExtensionSupported(const char *extName);
 
 #endif // !__SG_EXTENSIONS_HXX