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
2022-12-29 09:01:56 -08:00
2022-12-29 23:12:19 -08:00
2022-12-29 23:12:19 -08:00
2022-12-29 23:12:19 -08:00
2022-12-29 23:12:19 -08:00
2022-12-29 23:12:19 -08:00
2022-12-29 09:01:56 -08:00
2022-01-03 09:40:21 -08:00
2022-12-29 23:12:19 -08:00

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)

Description
Simple Directmedia Layer
Readme 180 MiB
Languages
C 86.4%
C++ 5.8%
Objective-C 3.4%
CMake 1.6%
Perl 0.8%
Other 1.7%