From 7ce9b578a4433f9606b14291fb3b816aa67999d9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 22 Nov 2020 12:34:35 +0100 Subject: 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. --- bindings/cxx/include/pugl/gl.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bindings') diff --git a/bindings/cxx/include/pugl/gl.hpp b/bindings/cxx/include/pugl/gl.hpp index ba7143b..529babb 100644 --- a/bindings/cxx/include/pugl/gl.hpp +++ b/bindings/cxx/include/pugl/gl.hpp @@ -24,6 +24,7 @@ #include "pugl/gl.h" #include "pugl/pugl.h" +#include "pugl/pugl.hpp" namespace pugl { @@ -44,6 +45,20 @@ getProcAddress(const char* name) noexcept return puglGetProcAddress(name); } +/// @copydoc puglEnterContext +inline Status +enterContext(View& view) noexcept +{ + return static_cast(puglEnterContext(view.cobj())); +} + +/// @copydoc puglLeaveContext +inline Status +leaveContext(View& view) noexcept +{ + return static_cast(puglLeaveContext(view.cobj())); +} + /// @copydoc puglGlBackend inline const PuglBackend* glBackend() noexcept -- cgit v1.2.1