From 0ac494998fb21ecc782a953b927b4796dba133ec Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 9 Dec 2023 17:13:58 -0600 Subject: [PATCH] [glutils] Add wrapper function around resizeInitFrameBuffer --- src/glutils/glutils.cpp | 4 ++++ src/glutils/glutils.hpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/glutils/glutils.cpp b/src/glutils/glutils.cpp index 7c077bf0..dc836bdc 100644 --- a/src/glutils/glutils.cpp +++ b/src/glutils/glutils.cpp @@ -172,6 +172,10 @@ void resizeInitFrameBuffer(FrameBuffer &fb, int width, int height) noexcept { glBindRenderbuffer(GL_RENDERBUFFER, 0); } +void resizeInitFrameBuffer(FrameBuffer &fb, ox::Size const&sz) noexcept { + resizeInitFrameBuffer(fb, sz.width, sz.height); +} + void sendVbo(BufferSet const&bs) noexcept { const auto bufferSize = static_cast(sizeof(decltype(bs.vertices)::value_type) * bs.vertices.size()); glBindBuffer(GL_ARRAY_BUFFER, bs.vbo); diff --git a/src/glutils/glutils.hpp b/src/glutils/glutils.hpp index c7a57d71..4647157b 100644 --- a/src/glutils/glutils.hpp +++ b/src/glutils/glutils.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -164,6 +165,8 @@ FrameBuffer generateFrameBuffer(int width, int height) noexcept; */ void resizeInitFrameBuffer(FrameBuffer &fb, int width, int height) noexcept; +void resizeInitFrameBuffer(FrameBuffer &fb, ox::Size const&sz) noexcept; + struct BufferSet { glutils::GLVertexArray vao; glutils::GLBuffer vbo;