diff options
author | David Robillard <d@drobilla.net> | 2020-10-31 13:00:48 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-31 13:00:48 +0100 |
commit | 5d7ddd8c2d714439ad07b54622600b11a9e980a0 (patch) | |
tree | 8673a4ec468cf34fd04f9ebc134a04aa77ed3687 /bindings/cxx/include/pugl/pugl.hpp | |
parent | af3d564e89ceeda506cbce8ff329ee14c769f9a5 (diff) | |
download | pugl-5d7ddd8c2d714439ad07b54622600b11a9e980a0.tar.gz pugl-5d7ddd8c2d714439ad07b54622600b11a9e980a0.tar.bz2 pugl-5d7ddd8c2d714439ad07b54622600b11a9e980a0.zip |
Remove pugl::Clock
This is nice, but it bloats the header quite a bit for something that may not
be used and requires the C++ standard library.
Diffstat (limited to 'bindings/cxx/include/pugl/pugl.hpp')
-rw-r--r-- | bindings/cxx/include/pugl/pugl.hpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/bindings/cxx/include/pugl/pugl.hpp b/bindings/cxx/include/pugl/pugl.hpp index d5a91fb..19cf3fe 100644 --- a/bindings/cxx/include/pugl/pugl.hpp +++ b/bindings/cxx/include/pugl/pugl.hpp @@ -25,7 +25,6 @@ #include "pugl/pugl.h" #include <cassert> -#include <chrono> #include <cstdint> #include <stdexcept> #include <type_traits> @@ -220,8 +219,6 @@ strerror(const Status status) noexcept @{ */ -class World; - /// @copydoc PuglWorldType enum class WorldType { program, ///< @copydoc PUGL_PROGRAM @@ -239,36 +236,6 @@ static_assert(WorldFlag(PUGL_WORLD_THREADS) == WorldFlag::threads, ""); using WorldFlags = PuglWorldFlags; ///< @copydoc PuglWorldFlags -/** - A `std::chrono` compatible clock that uses Pugl time. -*/ -class Clock -{ -public: - using rep = double; ///< Time representation - using duration = std::chrono::duration<double>; ///< Duration in seconds - using time_point = std::chrono::time_point<Clock>; ///< A Pugl time point - - static constexpr bool is_steady = true; ///< Steady clock flag, always true - - /// Construct a clock that uses time from puglGetTime() - explicit Clock(World& world) - : _world{world} - {} - - Clock(const Clock&) = delete; - Clock& operator=(const Clock&) = delete; - - Clock(Clock&&) = delete; - Clock& operator=(Clock&&) = delete; - - /// Return the current time - time_point now() const; - -private: - const World& _world; -}; - /// @copydoc PuglWorld class World : public detail::Wrapper<PuglWorld, puglFreeWorld> { @@ -281,7 +248,6 @@ public: explicit World(WorldType type, WorldFlags flags) : Wrapper{puglNewWorld(static_cast<PuglWorldType>(type), flags)} - , _clock(*this) { if (!cobj()) { throw std::runtime_error("Failed to create pugl::World"); @@ -313,20 +279,8 @@ public: { return static_cast<Status>(puglUpdate(cobj(), timeout)); } - - /// Return a clock that uses Pugl time - const Clock& clock() { return _clock; } - -private: - Clock _clock; }; -inline Clock::time_point -Clock::now() const -{ - return time_point{duration{_world.time()}}; -} - /** @} @name View |