aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-02-17 21:09:23 +0100
committerDavid Robillard <d@drobilla.net>2019-02-17 21:43:06 +0100
commitee834a83860e614d565f5bb38cdfb8681ffa5f16 (patch)
treef8ef6ce44613f29e28b18698f9477d82e9af344c /pugl/pugl_osx.m
parent982c89102967169854208608874659a03998dd7e (diff)
downloadpugl-ee834a83860e614d565f5bb38cdfb8681ffa5f16.tar.gz
pugl-ee834a83860e614d565f5bb38cdfb8681ffa5f16.tar.bz2
pugl-ee834a83860e614d565f5bb38cdfb8681ffa5f16.zip
Add puglGetProcAddress for using OpenGL extensions
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 8e40907..e56a1a7 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -702,6 +702,22 @@ puglProcessEvents(PuglView* view)
return PUGL_SUCCESS;
}
+PuglGlFunc
+puglGetProcAddress(const char *name)
+{
+ CFBundleRef framework =
+ CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
+
+ CFStringRef symbol = CFStringCreateWithCString(
+ kCFAllocatorDefault, name, kCFStringEncodingASCII);
+
+ PuglGlFunc func = CFBundleGetFunctionPointerForName(framework, symbol);
+
+ CFRelease(symbol);
+
+ return func;
+}
+
void
puglPostRedisplay(PuglView* view)
{