4 #pragma warning (disable: 4055) // warning C4055: 'type cast' : from data pointer 'void *' to function pointer
5 #pragma warning (disable: 4152) // warning C4152: nonstandard extension, function/data pointer conversion in expression
9 #define WIN32_LEAN_AND_MEAN 1
16 libgl = LoadLibraryA(
"opengl32.dll");
24 static void *
get_proc(
const char *proc)
28 res = wglGetProcAddress(proc);
30 res = GetProcAddress(
libgl, proc);
33 #elif defined(__APPLE__) || defined(__APPLE_CC__)
34 #include <Carbon/Carbon.h>
41 bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
42 CFSTR(
"/System/Library/Frameworks/OpenGL.framework"),
43 kCFURLPOSIXPathStyle,
true);
45 bundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
46 assert(bundle !=
NULL);
55 static void *
get_proc(
const char *proc)
59 CFStringRef procname = CFStringCreateWithCString(kCFAllocatorDefault, proc,
60 kCFStringEncodingASCII);
61 res = CFBundleGetFunctionPointerForName(bundle, procname);
73 libgl = dlopen(
"libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
85 res = (
void*)glXGetProcAddress((
const GLubyte *) proc);
87 res = dlsym(
libgl, proc);