In the event handling loop of SDL2, calling the method SDL_GetMouseState(&x,&y); or using event.motion.x and event.motion.y fo
SDL_GetMouseState(&x,&y);
event.motion.x
event.motion.y