[SDL] SDL_SetRelativeMouseMode Starting Position

Alundra segura.mikael at orange.fr
Mon Sep 1 05:47:49 PDT 2014


Code:

SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER );
m_SDLWindow = SDL_CreateWindow( Title.GetData(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, 0 );
SDL_SetRelativeMouseMode( SDL_TRUE );
// Start the main Loop.
SDL_Quit();



Here the event code of the mouse called each beginning of the main loop :

Code:

case SDL_MOUSEMOTION :
{
  // Store the new mouse position.
  m_MousePositionX = Event.motion.x;
  m_MousePositionY = Event.motion.y;

  // Store the new mouse delta.
  m_MouseDeltaX = Event.motion.xrel;
  m_MouseDeltaY = Event.motion.yrel;

  // We stop here.
  break;
}







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20140901/5b1c4328/attachment-0001.htm>


More information about the SDL mailing list