diff options
Diffstat (limited to 'src/client/input.cc')
-rw-r--r-- | src/client/input.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index 1a61424..88d1dd3 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -28,6 +28,10 @@ float local_thrust; // last controlled entity unsigned int last_control = 0; +// mouse cursor position +int mouse_x = 0; +int mouse_y = 0; + void init() { con_print << "Initializing input..." << std::endl; @@ -117,6 +121,11 @@ void frame(float seconds) while (SDL_PollEvent(&event)) { switch (event.type) { + case SDL_MOUSEMOTION: + mouse_x = event.motion.x; + mouse_y = event.motion.y; + break; + case SDL_KEYUP: if (event.key.keysym.sym == SDLK_PRINT) { video::screenshot(); |