SDL School

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

xThe first value.
yThe second value.

Return value

The larger value.

Example

Snake
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.

See also