diff options
author | David Robillard <d@drobilla.net> | 2020-03-08 17:47:10 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-03-08 17:47:10 +0100 |
commit | 646af656d4094d44ad0fed615429cb8585db5724 (patch) | |
tree | 65b961cd3c286b9d6467a1a6ce982ed9d3f61275 /pugl/pugl.h | |
parent | f54e63ab63409b887621e77168de6b9790d3a3cf (diff) | |
download | pugl-646af656d4094d44ad0fed615429cb8585db5724.tar.gz pugl-646af656d4094d44ad0fed615429cb8585db5724.tar.bz2 pugl-646af656d4094d44ad0fed615429cb8585db5724.zip |
Add a user data handle to the world
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r-- | pugl/pugl.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h index 7b45f2d..d14c086 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -462,6 +462,11 @@ puglStrerror(PuglStatus status); typedef struct PuglWorldImpl PuglWorld; /** + Handle for the world's opaque user data. +*/ +typedef void* PuglWorldHandle; + +/** Create a new world. @return A new world, which must be later freed with puglFreeWorld(). @@ -476,6 +481,23 @@ PUGL_API void puglFreeWorld(PuglWorld* world); /** + Set the user data for the world. + + This is usually a pointer to a struct that contains all the state which must + be accessed by several views. + + The handle is opaque to Pugl and is not interpreted in any way. +*/ +PUGL_API void +puglSetWorldHandle(PuglWorld* world, PuglWorldHandle handle); + +/** + Get the user data for the world. +*/ +PUGL_API PuglWorldHandle +puglGetWorldHandle(PuglWorld* world); + +/** Return a pointer to the native handle of the world. @return @@ -580,7 +602,7 @@ typedef struct PuglBackendImpl PuglBackend; typedef uintptr_t PuglNativeWindow; /** - Handle for opaque user data. + Handle for a view's opaque user data. */ typedef void* PuglHandle; |