sdl/window: add set_logical_size(point)

Also changed get_logical_size to return point not SDL_Point.
This commit is contained in:
Tommy 2022-07-19 21:42:24 +12:00
parent eae182ba80
commit 2da7515722
2 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -20,6 +20,8 @@
* Contains a wrapper class for the SDL_Window class.
*/
#include "sdl/point.hpp"
#include <SDL2/SDL_video.h>
#include <string>
@ -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. */