From 2da7515722ca01fed5e08733ec929d89c86b2518 Mon Sep 17 00:00:00 2001 From: Tommy Date: Tue, 19 Jul 2022 21:42:24 +1200 Subject: [PATCH] sdl/window: add set_logical_size(point) Also changed get_logical_size to return point not SDL_Point. --- src/sdl/window.cpp | 7 ++++++- src/sdl/window.hpp | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sdl/window.cpp b/src/sdl/window.cpp index 48b344ba97a..4471ceebbab 100644 --- a/src/sdl/window.cpp +++ b/src/sdl/window.cpp @@ -193,7 +193,12 @@ void window::set_logical_size(int w, int h) update_input_dimensions(get_logical_size(), get_size()); } -SDL_Point window::get_logical_size() const +void window::set_logical_size(const point& p) +{ + set_logical_size(p.x, p.y); +} + +point window::get_logical_size() const { SDL_Renderer* r = SDL_GetRenderer(window_); int w, h; diff --git a/src/sdl/window.hpp b/src/sdl/window.hpp index 786890121c0..fd28288c50b 100644 --- a/src/sdl/window.hpp +++ b/src/sdl/window.hpp @@ -20,6 +20,8 @@ * Contains a wrapper class for the SDL_Window class. */ +#include "sdl/point.hpp" + #include #include @@ -180,8 +182,9 @@ public: * @param h Height of the window's rendering surface */ void set_logical_size(int w, int h); + void set_logical_size(const point& p); - SDL_Point get_logical_size() const; + point get_logical_size() const; void get_logical_size(int& w, int& h) const; /** The current pixel format of the renderer. */