mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-30 00:17:40 +00:00
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) { ... }
This commit is contained in:
parent
ead4f122e4
commit
7f23d71b6a
20 changed files with 149 additions and 7 deletions
|
@ -859,6 +859,8 @@ SDL3_0.0.0 {
|
|||
SDL_wcsncasecmp;
|
||||
SDL_wcsncmp;
|
||||
SDL_wcsstr;
|
||||
SDL_modf;
|
||||
SDL_modff;
|
||||
# extra symbols go here (don't modify this line)
|
||||
local: *;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue