From 6df77a23ab6ae169898901ff5bbde7ce081426f3 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 19 May 2024 22:13:57 -0500 Subject: [PATCH] [glutils] Add size function to FrameBuffer --- deps/glutils/include/glutils/glutils.hpp | 8 ++++++++ deps/ox/src/ox/std/smallmap.hpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deps/glutils/include/glutils/glutils.hpp b/deps/glutils/include/glutils/glutils.hpp index 6713e557..8ebc73a3 100644 --- a/deps/glutils/include/glutils/glutils.hpp +++ b/deps/glutils/include/glutils/glutils.hpp @@ -137,6 +137,14 @@ struct FrameBuffer { constexpr operator const GLuint&() const noexcept { return fbo.id; } + + [[nodiscard]] + constexpr ox::Size size() const noexcept { + return { + width, + height, + }; + } }; class FrameBufferBind { diff --git a/deps/ox/src/ox/std/smallmap.hpp b/deps/ox/src/ox/std/smallmap.hpp index 5bf84fa8..28f2d43e 100644 --- a/deps/ox/src/ox/std/smallmap.hpp +++ b/deps/ox/src/ox/std/smallmap.hpp @@ -204,12 +204,12 @@ constexpr T &SmallMap::value(size_t i) noexcept { } template -constexpr typename SmallMap::Pair const&SmallMap::get(size_t i) const noexcept { +constexpr SmallMap::Pair const&SmallMap::get(size_t i) const noexcept { return m_pairs[i]; } template -constexpr typename SmallMap::Pair &SmallMap::get(size_t i) noexcept { +constexpr SmallMap::Pair &SmallMap::get(size_t i) noexcept { return m_pairs[i]; }