From e8a4474319aca4a32869fa1ebb8b5ebbd98237f6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Aug 2013 21:49:42 +0300 Subject: save Client object into global variable. --- src/client.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 2d1a2d82b..6cb9ac028 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -155,6 +155,7 @@ Configuration serverConfig; // XML file server configuration reader Configuration features; // XML file features Configuration branding; // XML branding information reader Configuration paths; // XML default paths information reader +Client *client = nullptr; Logger *logger = nullptr; // Log object ChatLogger *chatLogger = nullptr; // Chat log object KeyboardConfig keyboard; @@ -1000,16 +1001,7 @@ int Client::gameExec() #ifdef USE_SDL2 case SDL_WINDOWEVENT: { - switch (event.window.event) - { - // +++ need add other window events - case SDL_WINDOWEVENT_RESIZED: - resizeVideo(event.window.data1, - event.window.data2, false); - break; - default: - break; - } + handleSDL2WindowEvent(event); break; } #else @@ -3165,3 +3157,18 @@ void Client::setIcon() } #endif } + +#ifdef USE_SDL2 +void Client::handleSDL2WindowEvent(const SDL_Event &event) +{ + switch (event.window.event) + { + // +++ need add other window events + case SDL_WINDOWEVENT_RESIZED: + resizeVideo(event.window.data1, event.window.data2, false); + break; + default: + break; + } +} +#endif -- cgit v1.2.3-70-g09d2