diff options
author | David Robillard <d@drobilla.net> | 2020-11-22 12:34:35 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-25 14:18:04 +0100 |
commit | 7ce9b578a4433f9606b14291fb3b816aa67999d9 (patch) | |
tree | 917fd395aac4708142776b3826900f94e859de53 /include | |
parent | 3e9a2e01da169007b6fc16492f812055645f6d5f (diff) | |
download | pugl-7ce9b578a4433f9606b14291fb3b816aa67999d9.tar.gz pugl-7ce9b578a4433f9606b14291fb3b816aa67999d9.tar.bz2 pugl-7ce9b578a4433f9606b14291fb3b816aa67999d9.zip |
Move puglEnterContext and puglLeaveContext to GL backends
These only do anything for OpenGL, and it seems unlikely that they will ever be
used for anything else. So, move them to the GL headers to remove clutter from
the core API, and ensure that they are only used in GL applications that
include the appropriate headers and link with a GL backend.
Also add missing C++ bindings.
Diffstat (limited to 'include')
-rw-r--r-- | include/pugl/gl.h | 18 | ||||
-rw-r--r-- | include/pugl/pugl.h | 30 |
2 files changed, 18 insertions, 30 deletions
diff --git a/include/pugl/gl.h b/include/pugl/gl.h index 36b2887..79cb6e9 100644 --- a/include/pugl/gl.h +++ b/include/pugl/gl.h @@ -74,6 +74,24 @@ PUGL_API PuglGlFunc puglGetProcAddress(const char* name); /** + Enter the OpenGL context. + + This can be used to enter the graphics context in unusual situations, for + doing things like loading textures. Note that this must not be used for + drawing, which may only be done while processing an expose event. +*/ +PUGL_API PuglStatus +puglEnterContext(PuglView* view); + +/** + Leave the OpenGL context. + + This must only be called after puglEnterContext(). +*/ +PUGL_API PuglStatus +puglLeaveContext(PuglView* view); + +/** OpenGL graphics backend. Pass the returned value to puglSetBackend() to draw to a view with OpenGL. diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 4018c45..30d92c6 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -1064,36 +1064,6 @@ puglGetNativeWindow(PuglView* view); */ /** - Enter the graphics context. - - This can be used to enter the graphics context in unusual situations, for - doing things like loading textures. Note that this must not be used for - drawing, which may only be done while processing an expose event. Note also - that initial setup should not use this, but instead be done while handling a - #PUGL_CREATE event. - - - Cairo: Does nothing. - - OpenGL: Sets the current OpenGL context. - - Stub: Does nothing. - - Vulkan: Does nothing. -*/ -PUGL_API PuglStatus -puglEnterContext(PuglView* view); - -/** - Leave the graphics context. - - This must only be called after puglEnterContext(). - - - Cairo: Does nothing. - - OpenGL: Resets the current OpenGL context. - - Stub: Does nothing. - - Vulkan: Does nothing. -*/ -PUGL_API PuglStatus -puglLeaveContext(PuglView* view); - -/** Get the graphics context. This is a backend-specific context used for drawing if the backend graphics |