From 989583c029d333edd99e96cdf51bce3d2ff2acf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Wiesner?= Date: Sun, 1 Mar 2020 17:48:06 +0100 Subject: [PATCH] =?UTF-8?q?F=C3=A9lig=20bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Window.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Window.cpp b/Window.cpp index 97372c4..79d8233 100644 --- a/Window.cpp +++ b/Window.cpp @@ -118,18 +118,20 @@ namespace eg3d { LRESULT Window::smWindowFunc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { Window * pWindow = static_cast((void *)GetWindowLongPtrA(hwnd, GWLP_USERDATA)); // ablakhoz rendelt eseménykezelő elkérése - + switch (message) { case WM_DESTROY: PostQuitMessage(0); break; default: // minden egyéb esemény kezelése - if (pWindow-> != nullptr) { // ha meg van adva eseménykezelő - if (pEH->processEvent(hwnd, message, wParam, lParam) != 0) { // ha nem lett lekezelve az esemény + if (pWindow != nullptr && pWindow->getEventHandler() != nullptr) { // ha meg van adva eseménykezelő + /*if (pWindow->getEventHandler()->processEvent(hwnd, message, wParam, lParam) != 0) { // ha nem lett lekezelve az esemény return DefWindowProc(hwnd, message, wParam, lParam); // ...akkor rábízzuk a rendszerre - } + }*/ } + + return DefWindowProc(hwnd, message, wParam, lParam); // ...akkor rábízzuk a rendszerre } return 0; @@ -150,7 +152,7 @@ namespace eg3d { gEntryArgs.hThisInstance, nullptr); - SetWindowLongPtrA(mHWND, GWLP_USERDATA, (LONG_PTR) this); + SetWindowLongPtrA(mHWND, GWLP_USERDATA, reinterpret_cast(this)); } HWND Window::getHandle() const {