Sam Lantinga
7f23d71b6a
Added SDL_modf() and SDL_modff()
...
This function is useful for accumulating relative mouse motion if you want to only handle whole pixel movement.
e.g.
static float dx_frac, dy_frac;
float dx, dy;
/* Accumulate new motion with previous sub-pixel motion */
dx = event.motion.xrel + dx_frac;
dy = event.motion.yrel + dy_frac;
/* Split the integral and fractional motion, dx and dy will contain whole pixel deltas */
dx_frac = SDL_modff(dx, &dx);
dy_frac = SDL_modff(dy, &dy);
if (dx != 0.0f || dy != 0.0f) {
...
}
2022-12-29 23:12:19 -08:00
..
2022-12-29 13:58:16 -08:00
2022-12-26 11:17:23 -08:00
2022-12-27 10:35:53 -08:00
2022-12-29 13:58:16 -08:00
2022-12-26 11:17:23 -08:00
2022-12-27 06:21:13 -08:00
2022-12-26 11:17:23 -08:00
2022-12-27 12:31:12 -08:00
2022-11-26 22:15:18 -08:00
2022-12-26 11:17:23 -08:00
2022-11-26 22:15:18 -08:00
2022-12-29 13:58:16 -08:00
2022-12-26 11:17:23 -08:00
2022-12-29 23:12:19 -08:00
2022-12-26 11:17:23 -08:00
2022-12-29 22:10:35 -08:00
2022-12-26 11:17:23 -08:00
2022-12-27 10:35:53 -08:00
2022-12-26 11:17:23 -08:00
2022-12-27 09:47:24 -08:00
2022-12-27 09:47:24 -08:00
2022-12-29 22:10:35 -08:00
2022-12-28 19:40:25 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-27 12:31:12 -08:00
2022-12-26 11:17:23 -08:00
2022-12-29 21:50:58 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-22 11:39:26 -05:00
2022-12-26 11:17:23 -08:00
2022-12-29 23:12:19 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-29 15:07:15 -08:00
2022-11-26 22:15:18 -08:00
2022-12-26 11:17:23 -08:00
2022-11-26 22:15:18 -08:00
2022-11-26 22:15:18 -08:00
2022-11-26 22:15:18 -08:00
2022-11-26 22:15:18 -08:00
2022-11-26 22:15:18 -08:00
2022-11-26 22:15:18 -08:00
2022-12-27 06:08:31 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-11-26 22:15:18 -08:00
2022-12-29 14:50:31 -08:00
2022-12-29 23:12:19 -08:00
2022-11-26 22:15:18 -08:00
2022-12-29 15:07:15 -08:00
2022-12-26 11:17:23 -08:00
2022-12-28 13:10:27 -08:00
2022-12-22 11:39:26 -05:00
2022-12-29 23:12:19 -08:00
2022-12-27 06:36:39 -08:00
2022-12-28 19:40:25 -08:00
2022-12-28 17:49:34 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-27 00:10:00 +03:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-26 11:17:23 -08:00
2022-12-29 13:34:53 -05:00
2022-12-22 11:39:26 -05:00
2022-12-27 09:47:24 -08:00