libdraw

Minimal window and drawing library
git clone http://git.omkov.net/libdraw
Log | Tree | Refs | Download

libdraw/src/util/util.h (13 lines, 348 B) -rw-r--r-- blame download

0123456789101112
// Copyright (C) 2024, Jakob Wakeling
// All rights reserved.

#ifndef LIBDRAW_UTIL_UTIL_H_9VY05T8I
#define LIBDRAW_UTIL_UTIL_H_9VY05T8I

#define MIN(a, b) ((a < b) ? a : b)
#define MAX(a, b) ((a > b) ? a : b)
#define CLAMP(x, a, b) (MIN(MAX(x, a), b))
#define IS_CLAMPED(x, a, b) ((x) >= (a) && (x) <= (b))

#endif // LIBDRAW_UTIL_UTIL_H_9VY05T8I