[SDL] Why do I get so few points(SDL_MOUSEMOTION) when I move fast

NetCraft intraden at mail.ru
Tue Sep 13 07:45:12 PDT 2016


My code in mainloop is:

Code:
SDL_Event event;
while ( SDL_PollEvent( &event ) ) {
	switch( event.type ) {
		case SDL_MOUSEMOTION:
			std::ostringstream os;
			os << "coords: " << (float)event.motion.x << "x" << (float)event.motion.y << "\n";
			std::cout << os.str().c_str() << std::endl;
		break;
	}
}



The FPS of "this code" is about 500-700FPS. I move my mouse cursor very fast.
Why do I get so few points(SDL_MOUSEMOTION) when I move my cursor VERY fast from left corner of my window to the right corner (my window's size is: 900x500). I expected to see at least 50-100 points but I get only 2-3 points.

I don't understand why does it work like this? I loose many points I don't know how to catch them. If I move my cursor slowly - it works fine but when it comes to really fast mouse moving from one corner to another all falls apart.

Any suggestions? :)




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20160913/7e89d621/attachment.htm>


More information about the SDL mailing list