mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Add window size getters
This commit is contained in:
parent
648a43369b
commit
c89ec85164
@ -46,6 +46,24 @@ Window& Window::operator=(Window&& other) noexcept {
|
||||
return *this;
|
||||
}
|
||||
|
||||
Point Window::GetSize() const {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(window_, &w, &h);
|
||||
return Point(w, h);
|
||||
}
|
||||
|
||||
int Window::GetWidth() const {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(window_, &w, &h);
|
||||
return w;
|
||||
}
|
||||
|
||||
int Window::GetHeight() const {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(window_, &w, &h);
|
||||
return h;
|
||||
}
|
||||
|
||||
SDL_Window* Window::Get() const {
|
||||
return window_;
|
||||
}
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include <SDL2/SDL_stdinc.h>
|
||||
|
||||
#include <SDL2pp/Point.hh>
|
||||
|
||||
struct SDL_Window;
|
||||
|
||||
namespace SDL2pp {
|
||||
@ -41,6 +43,10 @@ public:
|
||||
Window& operator=(const Window& other) = delete;
|
||||
Window& operator=(Window&& other) noexcept;
|
||||
|
||||
Point GetSize() const;
|
||||
int GetWidth() const;
|
||||
int GetHeight() const;
|
||||
|
||||
SDL_Window* Get() const;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user