SDL_CompareCallback(3type)

SDL_CompareCallback3type

A callback used with sdl sorting and binary search functions.

Usage

#include "SDL3/SDL.h"

typedef int (SDLCALL *SDL_CompareCallback)(const void *a, const void *b);

Header file

Defined in SDL3/SDL_stdinc.h

Function parameters

a

a pointer to the first element being compared.

b

a pointer to the second element being compared.

Return value

Returns -1 if a should be sorted before b , 1 if b should be sorted before a , 0 if they are equal. If two elements are equal, their order in the sorted array is undefined.

Availability

This callback is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.