mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 07:19:48 +00:00
sdl/window: add set_logical_size(point)
Also changed get_logical_size to return point not SDL_Point.
This commit is contained in:
parent
eae182ba80
commit
2da7515722
@ -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;
|
||||
|
@ -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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user