|
From: <c99...@us...> - 2007-05-01 20:42:55
|
Revision: 400
http://svn.sourceforge.net/cadcdev/?rev=400&view=rev
Author: c99koder
Date: 2007-05-01 13:42:51 -0700 (Tue, 01 May 2007)
Log Message:
-----------
Tiki: win32: Make Tiki multitask better and support mouse wheel events
Modified Paths:
--------------
tiki/win32/src/platgl.cpp
tiki/win32/src/plathid.cpp
Modified: tiki/win32/src/platgl.cpp
===================================================================
--- tiki/win32/src/platgl.cpp 2007-05-01 19:20:11 UTC (rev 399)
+++ tiki/win32/src/platgl.cpp 2007-05-01 20:42:51 UTC (rev 400)
@@ -109,10 +109,16 @@
m_hThread = CreateThread(NULL, 0, GameThread, lpCmdLine, 0, &m_dwThreadID);
- while(m_hThread != NULL && GetMessage(&msg, NULL, 0, 0))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
+ while(m_hThread != NULL) {
+ do {
+ if (GetMessage(&msg, NULL, NULL, NULL)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ } while (::PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE));
+
+ Sleep(2);
}
return (int)msg.wParam;
@@ -135,6 +141,9 @@
case WM_MBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
+#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) //WM_MOUSEWHEEL requires Windows 98 or above
+ case WM_MOUSEWHEEL:
+#endif
Tiki::RecvEvent(iMsg, wParam, lParam);
break;
case WM_CLOSE:
Modified: tiki/win32/src/plathid.cpp
===================================================================
--- tiki/win32/src/plathid.cpp 2007-05-01 19:20:11 UTC (rev 399)
+++ tiki/win32/src/plathid.cpp 2007-05-01 20:42:51 UTC (rev 400)
@@ -1,6 +1,5 @@
#include "pch.h"
#include "Tiki/hid.h"
-
using namespace Tiki::Hid;
class KbDevice : public Device {
@@ -185,6 +184,7 @@
evt.y = HIWORD(lParam);
sendEvent(evt);
}
+ break;
case WM_LBUTTONUP:
case WM_LBUTTONDOWN:
@@ -196,6 +196,7 @@
evt.y = HIWORD(lParam);
sendEvent(evt);
}
+ break;
case WM_MBUTTONUP:
case WM_MBUTTONDOWN:
@@ -207,6 +208,7 @@
evt.y = HIWORD(lParam);
sendEvent(evt);
}
+ break;
case WM_RBUTTONUP:
case WM_RBUTTONDOWN:
@@ -218,7 +220,19 @@
evt.y = HIWORD(lParam);
sendEvent(evt);
}
-
+ break;
+#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) //WM_MOUSEWHEEL requires Windows 98 or above
+ case WM_MOUSEWHEEL:
+ {
+ Event evt(Event::EvtBtnPress);
+ evt.dev = win32mouse;
+ evt.btn = (GET_WHEEL_DELTA_WPARAM(wParam) < 0) ? Event::MouseWheelDown : Event::MouseWheelUp;
+ evt.x = LOWORD(lParam);
+ evt.y = HIWORD(lParam);
+ sendEvent(evt);
+ }
+ break;
+#endif
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|