Scroll to navigation

SDL_CompareCallback(3type) SDL3 DATATYPES SDL_CompareCallback(3type)

NAME

SDL_CompareCallback - A callback used with SDL sorting and binary search functions.

HEADER FILE

Defined in SDL3/SDL_stdinc.h

SYNOPSIS

#include "SDL3/SDL.h"
typedef int (SDLCALL *SDL_CompareCallback)(const void *a, const void *b);

FUNCTION PARAMETERS

a pointer to the first element being compared.
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.

SEE ALSO

(3), SDL_bsearch(3), (3), SDL_qsort(3)

SDL 3.2.2 Simple Directmedia Layer