API reference / Math
SDL_max
Macro, SDL3
Gives the larger of two values. This is a macro.
Declaration
#include <SDL3/SDL.h>
#define SDL_max(x, y)Parameters
x | The first value. |
y | The second value. |
Return value
The larger value.
Example
move_delay = SDL_max(move_delay - SPEED_UP, MIN_DELAY);See this code run in Snake. Download the full program (.zip)
In SDL2
The name is the same.