added width() and height() getters
This commit is contained in:
parent
05cf3ba0e2
commit
6097614905
12
Window.cpp
12
Window.cpp
@ -143,3 +143,15 @@ bool Window::handle_event(const SDL_Event& event, bool quit) {
|
||||
}
|
||||
return quit;
|
||||
}
|
||||
|
||||
int Window::width() const {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(_w.get(), &w, &h);
|
||||
return w;
|
||||
}
|
||||
|
||||
int Window::height() const {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(_w.get(), &w, &h);
|
||||
return h;
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ namespace sc {
|
||||
SDL_Texture* texture() const { return _t.get(); }
|
||||
|
||||
void set_size(int w, int h);
|
||||
int width() const;
|
||||
int height() const;
|
||||
|
||||
void update() const;
|
||||
void show_image(const Image& image);
|
||||
|
Loading…
x
Reference in New Issue
Block a user