Changeset 304 for trunk/src/gl/gl_window.cc
- Timestamp:
- 08/11/14 11:56:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_window.cc
r295 r304 115 115 case SDL_BUTTON_MIDDLE : mevent.mbutton.button = MOUSE_MIDDLE; break; 116 116 case SDL_BUTTON_RIGHT : mevent.mbutton.button = MOUSE_RIGHT; break; 117 //case SDL_BUTTON_WHEELUP : mevent.mbutton.button = MOUSE_WHEEL_UP; break; 118 //case SDL_BUTTON_WHEELDOWN : mevent.mbutton.button = MOUSE_WHEEL_DOWN; break; 117 #if NV_SDL_VERSION == NV_SDL_12 118 case SDL_BUTTON_WHEELUP : 119 mevent.type = EV_MOUSE_WHEEL; 120 mevent.mwheel.x = 0; 121 mevent.mwheel.y = 3; 122 return true; 123 case SDL_BUTTON_WHEELDOWN : 124 mevent.type = EV_MOUSE_WHEEL; 125 mevent.mwheel.x = 0; 126 mevent.mwheel.y = -3; 127 return true; 128 #endif 119 129 default : break; 120 130 } … … 122 132 return mevent.mbutton.button != MOUSE_NONE; 123 133 } 134 135 #if NV_SDL_VERSION == NV_SDL_20 136 static bool sdl_mouse_wheel_to_io_event( const SDL_MouseWheelEvent& mm, io_event& mevent ) 137 { 138 mevent.type = EV_MOUSE_WHEEL; 139 mevent.mwheel.x = static_cast< sint32 >( mm.x ); 140 mevent.mwheel.y = static_cast< sint32 >( mm.y ); 141 return true; 142 } 143 #endif 124 144 125 145 static bool sdl_mouse_motion_to_io_event( const SDL_MouseMotionEvent& mm, io_event& mevent ) … … 180 200 case SDL_MOUSEBUTTONDOWN : return sdl_mouse_button_to_io_event( e.button, ioevent ); 181 201 case SDL_MOUSEBUTTONUP : return sdl_mouse_button_to_io_event( e.button, ioevent ); 202 #if NV_SDL_VERSION == NV_SDL_20 203 case SDL_MOUSEWHEEL : return sdl_mouse_wheel_to_io_event( e.wheel, ioevent ); 204 #endif 182 205 /* // SDL 2.0 incompatible 183 206 case SDL_ACTIVEEVENT :
Note: See TracChangeset
for help on using the changeset viewer.