aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pugl/detail/mac.m6
-rw-r--r--pugl/detail/win.c6
-rw-r--r--pugl/detail/x11.c6
-rw-r--r--pugl/pugl.h10
4 files changed, 28 insertions, 0 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index e8a5d57..f530c2e 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -695,6 +695,12 @@ puglFreeWorldInternals(PuglWorld* world)
free(world->impl);
}
+void*
+puglGetNativeWorld(PuglWorld* world)
+{
+ return NULL;
+}
+
PuglInternals*
puglInitViewInternals(void)
{
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index e1deaf1..ee7eb01 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -130,6 +130,12 @@ puglInitWorldInternals(void)
return impl;
}
+void*
+puglGetNativeWorld(PuglWorld* PUGL_UNUSED(world))
+{
+ return GetModuleHandle(NULL);
+}
+
PuglInternals*
puglInitViewInternals(void)
{
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index fd47db3..e576b49 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -101,6 +101,12 @@ puglInitWorldInternals(void)
return impl;
}
+void*
+puglGetNativeWorld(PuglWorld* world)
+{
+ return world->impl->display;
+}
+
PuglInternals*
puglInitViewInternals(void)
{
diff --git a/pugl/pugl.h b/pugl/pugl.h
index 70d6f42..1344410 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -442,6 +442,16 @@ PUGL_API void
puglFreeWorld(PuglWorld* world);
/**
+ Return a pointer to the native handle of the world.
+
+ On X11, this returns a pointer to the Display.
+ On OSX, this returns NULL.
+ On Windows, this returns a handle to the calling process module.
+*/
+PUGL_API void*
+puglGetNativeWorld(PuglWorld* world);
+
+/**
Set the class name of the application.
This is a stable identifier for the application, used as the window