diff options
author | Maarten Gribnau <mail@maartengribnau.com> | 2003-01-28 00:35:26 +0300 |
---|---|---|
committer | Maarten Gribnau <mail@maartengribnau.com> | 2003-01-28 00:35:26 +0300 |
commit | 6478b3aa942516d22201f0939aa2fd666e21c9b9 (patch) | |
tree | 61cb2a065f619f513a245131049ea3de91e25762 /intern/ghost/test/gears | |
parent | 3396a234990f6c2bcc25de0b99a003d69bcc961a (diff) |
Added mouse wheel support for windows.
Both gears (C and C++) projects contain an example.
Maarten
Diffstat (limited to 'intern/ghost/test/gears')
-rw-r--r-- | intern/ghost/test/gears/GHOST_C-Test.c | 16 | ||||
-rwxr-xr-x | intern/ghost/test/gears/GHOST_Test.cpp | 24 |
2 files changed, 35 insertions, 5 deletions
diff --git a/intern/ghost/test/gears/GHOST_C-Test.c b/intern/ghost/test/gears/GHOST_C-Test.c index bb4ecd0082e..9fd4e155b3b 100644 --- a/intern/ghost/test/gears/GHOST_C-Test.c +++ b/intern/ghost/test/gears/GHOST_C-Test.c @@ -297,6 +297,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData) int cursor; int visibility; GHOST_TEventKeyData* keyData = NULL; + GHOST_TEventWheelData* wheelData = NULL; GHOST_DisplaySetting setting; GHOST_WindowHandle window = GHOST_GetEventWindow(hEvent); @@ -310,6 +311,20 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData) case GHOST_kEventCursorMove: break; */ + case GHOST_kEventWheel: + { + wheelData = (GHOST_TEventWheelData*)GHOST_GetEventData(hEvent); + if (wheelData->z > 0) + { + view_rotz += 5.f; + } + else + { + view_rotz -= 5.f; + } + } + break; + case GHOST_kEventKeyUp: break; @@ -347,6 +362,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData) */ sFullScreenWindow = GHOST_BeginFullScreen(shSystem, &setting, + FALSE /* stereo flag */); } else diff --git a/intern/ghost/test/gears/GHOST_Test.cpp b/intern/ghost/test/gears/GHOST_Test.cpp index 95fd0772269..3abdd3977eb 100755 --- a/intern/ghost/test/gears/GHOST_Test.cpp +++ b/intern/ghost/test/gears/GHOST_Test.cpp @@ -275,7 +275,7 @@ static void View(GHOST_IWindow* window, bool stereo, int eye = 0) int verticalBlankingInterval = 32; // hard coded for testing purposes, display device dependant float left, right, bottom, top; float nearplane, farplane, zeroPlane, distance; - float eyeSeparation = 0.62; + float eyeSeparation = 0.62f; window->getClientBounds(bnds); // viewport @@ -314,8 +314,8 @@ static void View(GHOST_IWindow* window, bool stereo, int eye = 0) // projection left = -6.0; right = 6.0; - bottom = -4.8; - top = 4.8; + bottom = -4.8f; + top = 4.8f; nearplane = 5.0; farplane = 60.0; @@ -481,6 +481,20 @@ bool Application::processEvent(GHOST_IEvent* event) case GHOST_kEventCursorMove: std::cout << "GHOST_kEventCursorMove"; break; */ + case GHOST_kEventWheel: + { + GHOST_TEventWheelData* wheelData = (GHOST_TEventWheelData*) event->getData(); + if (wheelData->z > 0) + { + view_rotz += 5.f; + } + else + { + view_rotz -= 5.f; + } + } + break; + case GHOST_kEventKeyUp: break; @@ -678,10 +692,10 @@ int main(int /*argc*/, char** /*argv*/) LONG lresult; HKEY hkey = 0; DWORD dwd = 0; - unsigned char buffer[128]; + //unsigned char buffer[128]; CRegKey regkey; - DWORD keyValue; + //DWORD keyValue; // lresult = regkey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable"); lresult = regkey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable", KEY_ALL_ACCESS ); |