mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-05 11:56:00 -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;
|
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 {
|
SDL_Window* Window::Get() const {
|
||||||
return window_;
|
return window_;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include <SDL2/SDL_stdinc.h>
|
#include <SDL2/SDL_stdinc.h>
|
||||||
|
|
||||||
|
#include <SDL2pp/Point.hh>
|
||||||
|
|
||||||
struct SDL_Window;
|
struct SDL_Window;
|
||||||
|
|
||||||
namespace SDL2pp {
|
namespace SDL2pp {
|
||||||
@ -41,6 +43,10 @@ public:
|
|||||||
Window& operator=(const Window& other) = delete;
|
Window& operator=(const Window& other) = delete;
|
||||||
Window& operator=(Window&& other) noexcept;
|
Window& operator=(Window&& other) noexcept;
|
||||||
|
|
||||||
|
Point GetSize() const;
|
||||||
|
int GetWidth() const;
|
||||||
|
int GetHeight() const;
|
||||||
|
|
||||||
SDL_Window* Get() const;
|
SDL_Window* Get() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user