SDL/include/build_config
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
..
SDL_build_config.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_build_config.h.cmake Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
SDL_build_config_android.h Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
SDL_build_config_emscripten.h Remove underscore in guard header defines (#6922) 2022-12-27 12:31:12 -08:00
SDL_build_config_ios.h Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
SDL_build_config_macos.h Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
SDL_build_config_minimal.h More cleanup for #6619 2022-12-01 12:53:11 -08:00
SDL_build_config_ngage.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_build_config_windows.h Removed the vi format comments from the source 2022-12-26 11:17:23 -08:00
SDL_build_config_wingdk.h Removed the vi format comments from the source 2022-12-26 11:17:23 -08:00
SDL_build_config_winrt.h Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
SDL_build_config_xbox.h Removed the vi format comments from the source 2022-12-26 11:17:23 -08:00
SDL_revision.h.cmake cmake: avoid copy of headers by moving generated headers to include/build_config (thanks @madebr!) 2022-11-26 15:37:08 -08:00