75double clamp_d(
double value,
double min,
double max);
84float clamp_f(
float value,
float min,
float max);
102double lerp_d(
double a,
double b,
double t);
158#define MAX_INTERNAL_CMDFX_MUTEXES 128
252#define ThreadID uintptr_t
255#define ThreadID pthread_t
int CmdFX_detachThread(ThreadID thread)
Detaches a thread.
int CmdFX_unlockMutex(void *mutex)
Unlocks a mutex.
int CmdFX_joinThread(ThreadID thread)
Joins a thread.
ThreadID CmdFX_launchThread(void(*func)(void *), void *arg)
Launches a thread.
double lerp_d(double a, double b, double t)
Linearly interpolates between two values.
int CmdFX_isThreadSafeEnabled()
Checks if thread-safe functions are enabled.
void rgb_to_hsv(int rgb, double *h, double *s, double *v)
Converts an RGB color to HSV.
int lerp_i(int a, int b, double t)
Linearly interpolates between two values.
float lerp_f(float a, float b, float t)
Linearly interpolates between two values.
void CmdFX_tryUnlockMutex(int id)
Tries to unlock a mutex.
int CmdFX_initThreadSafe()
Initializes thread-safe functions.
int hsv_to_rgb(double h, double s, double v)
Converts an HSV color to RGB.
int CmdFX_setTickSpeed(int tickspeed)
Sets the tick speed of cmdfx.
int lerp_color(int rgb1, int rgb2, double t)
Linearly interpolates between two colors.
float clamp_f(float value, float min, float max)
Clamps a value between a minimum and maximum.
unsigned long currentTimeMillis()
Gets the current time in milliseconds.
int CmdFX_lockMutex(void *mutex)
Locks a mutex.
void sleepMillis(unsigned long millis)
Pauses the program for a specified number of milliseconds.
int clamp_i(int value, int min, int max)
Clamps a value between a minimum and maximum.
void sleepNanos(unsigned long long nanos)
Pauses the program for a specified number of nanoseconds.
double clamp_d(double value, double min, double max)
Clamps a value between a minimum and maximum.
void CmdFX_tryLockMutex(int id)
Tries to lock a mutex.
int CmdFX_getTickSpeed()
Gets the tick speed of cmdfx.
unsigned long long currentTimeNanos()
Gets the current time in nanoseconds.
int CmdFX_destroyThreadSafe()
Cleans up thread-safe functions.
void * CmdFX_getInternalMutex(int index)
Gets an internal mutex.