API reference / Math
SDL_min
Macro, SDL3
Gives the smaller of two values. This is a macro.
Declaration
#include <SDL3/SDL.h>
#define SDL_min(x, y)Parameters
x | The first value. |
y | The second value. |
Return value
The smaller value.
Example
ball_speed = SDL_min(ball_speed + BALL_SPEED_UP, BALL_MAX_SPEED);See this code run in Pong. Download the full program (.zip)
In SDL2
The name is the same.