Go to file
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
.github Cancel current CI actions when a PR is updated 2022-12-28 13:10:27 -08:00
VisualC Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
VisualC-GDK Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
VisualC-WinRT Split SDL gamepad internal functions into SDL_gamepad_c.h 2022-12-27 10:23:28 -08:00
Xcode cmake: add SDL3 to include path 2022-12-29 09:01:56 -08:00
android-project Android JAVA DetectDevices: 'is_capture' is inverted (#6845) 2022-12-18 16:55:59 +01:00
build-scripts Consistency cleanup for README-migration.md 2022-12-29 10:44:54 -08:00
cmake cmake: add SDL3 to include path 2022-12-29 09:01:56 -08:00
docs Mouse coordinates are floating point 2022-12-29 23:12:19 -08:00
include Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
mingw/pkg-support/cmake build: don't add SDL3 subfolder to include path for external projects 2022-11-27 14:33:13 -08:00
src Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
test Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
wayland-protocols wayland: Add high-resolution event timestamp support 2022-12-04 16:56:26 -08:00
.clang-format Commented out syntax that causes Visual Studio 2019 to complain on every edit 2022-12-02 00:43:01 -08:00
.editorconfig editorconfig: remove trailing whitespace in source code 2022-12-26 10:34:07 -08:00
.gitignore SDL API renaming: SDL_gamecontroller.h 2022-12-27 09:47:24 -08:00
.wikiheaders-options sdlwiki: SDL_version.h moved to include/SDL3 2022-12-19 09:19:45 -08:00
Android.mk Remove SDL3_main from build systems, remove most of src/main/* 2022-12-15 08:01:01 -08:00
BUGS.txt Cleaned up a few more Bugzilla mentions. 2021-02-12 14:46:49 -05:00
CMakeLists.txt Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00
CREDITS.txt Use Apple's nomenclature for macOS and iOS 2022-11-25 16:00:06 -08:00
INSTALL.txt Use Apple's nomenclature for macOS and iOS 2022-11-25 16:00:06 -08:00
LICENSE.txt Updated copyright for 2022 2022-01-03 09:40:21 -08:00
README-SDL.txt
README.md First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
TODO.txt Fixed up legacy MoinMoin URLs at wiki.libsdl.org 2021-04-01 12:20:33 -04:00
WhatsNew.txt Added SDL_modf() and SDL_modff() 2022-12-29 23:12:19 -08:00

README.md

Simple DirectMedia Layer (SDL) Version 3.0

https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting with README.md

Enjoy!

Sam Lantinga (slouken@libsdl.org)