changed get_window() to window() for consistency

This commit is contained in:
Bob Polis 2020-10-24 15:58:09 +02:00
parent 7382120a0b
commit b67f68cd6c
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ Window* Window::from_sdl(Uint32 window_id) {
SDL_Window* w {SDL_GetWindowFromID(window_id)};
if (w) {
auto it = std::find_if(_windows.begin(), _windows.end(), [w](Window& win) {
return win.get_window() == w;
return win.window() == w;
});
if (it != _windows.end()) {
return &*it;
@ -57,7 +57,7 @@ bool Window::handle_global_event(const SDL_Event& event) {
// remove window from window list
SDL_Window* w {SDL_GetWindowFromID(event.window.windowID)};
auto it = std::remove_if(_windows.begin(), _windows.end(), [w](Window& win) {
return win.get_window() == w;
return win.window() == w;
});
_windows.erase(it, _windows.end());
if (_windows.size() == 0) {

View File

@ -35,7 +35,7 @@ namespace sc {
void add_event_handler(WindowEventHandler handler, SDL_WindowEventID type);
bool handle_event(const SDL_Event& event, bool quit);
SDL_Window* get_window() const { return _w.get(); }
SDL_Window* window() const { return _w.get(); }
SDL_Renderer* renderer() const { return _r.get(); }
void set_size(int w, int h);