From c29aaaf66c1f4c11e8b3e4decbe129626b5553f3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 26 Nov 2020 15:56:44 +0100 Subject: Add pugl::World constructor overload that takes a flag Eventually we'll need an actual smart flags type here, but for now there's only one flag anyway, so simply define an overload that takes one. --- bindings/cxx/include/pugl/pugl.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bindings/cxx') diff --git a/bindings/cxx/include/pugl/pugl.hpp b/bindings/cxx/include/pugl/pugl.hpp index dd7389e..9e391fa 100644 --- a/bindings/cxx/include/pugl/pugl.hpp +++ b/bindings/cxx/include/pugl/pugl.hpp @@ -281,14 +281,21 @@ public: ~World() = default; - explicit World(WorldType type, WorldFlags flags) + World(WorldType type, WorldFlag flag) + : Wrapper{puglNewWorld(static_cast(type), + static_cast(flag))} + { + PUGL_CHECK_CONSTRUCTION(cobj(), "Failed to create pugl::World"); + } + + World(WorldType type, WorldFlags flags) : Wrapper{puglNewWorld(static_cast(type), flags)} { PUGL_CHECK_CONSTRUCTION(cobj(), "Failed to create pugl::World"); } explicit World(WorldType type) - : World{type, {}} + : World{type, WorldFlags{}} {} /// @copydoc puglGetNativeWorld -- cgit v1.2.1