handmade/include/SDL_clamp.h

7 lines
181 B
C
Raw Normal View History

#pragma once
/*
* <https://github.com/libsdl-org/SDL/commit/35c1bbfa49b1247c2c6240f7f95871f3b3331874>
*/
#define SDL_clamp(x, a, b) ((x) < (a)) ? (a) : (((x) > (b)) ? (b) : (x))