cmdfx 0.1.0
Lightweight game engine for your terminal
|
Cross-Platform Utilities for CmdFX. More...
Go to the source code of this file.
Functions | |
unsigned long | currentTimeMillis () |
Gets the current time in milliseconds. | |
unsigned long long | currentTimeNanos () |
Gets the current time in nanoseconds. | |
void | sleepMillis (unsigned long millis) |
Pauses the program for a specified number of milliseconds. | |
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. | |
float | clamp_f (float value, float min, float max) |
Clamps a value between a minimum and maximum. | |
int | clamp_i (int value, int min, int max) |
Clamps a value between a minimum and maximum. | |
double | lerp_d (double a, double b, double t) |
Linearly interpolates between two values. | |
float | lerp_f (float a, float b, float t) |
Linearly interpolates between two values. | |
int | lerp_i (int a, int b, double t) |
Linearly interpolates between two values. | |
void | rgb_to_hsv (int rgb, double *h, double *s, double *v) |
Converts an RGB color to HSV. | |
int | hsv_to_rgb (double h, double s, double v) |
Converts an HSV color to RGB. | |
int | lerp_color (int rgb1, int rgb2, double t) |
Linearly interpolates between two colors. | |
Cross-Platform Utilities for CmdFX.
double clamp_d | ( | double | value, |
double | min, | ||
double | max ) |
Clamps a value between a minimum and maximum.
value | The value to clamp. |
min | The minimum value. |
max | The maximum value. |
float clamp_f | ( | float | value, |
float | min, | ||
float | max ) |
Clamps a value between a minimum and maximum.
value | The value to clamp. |
min | The minimum value. |
max | The maximum value. |
int clamp_i | ( | int | value, |
int | min, | ||
int | max ) |
Clamps a value between a minimum and maximum.
value | The value to clamp. |
min | The minimum value. |
max | The maximum value. |
unsigned long currentTimeMillis | ( | ) |
Gets the current time in milliseconds.
unsigned long long currentTimeNanos | ( | ) |
Gets the current time in nanoseconds.
int hsv_to_rgb | ( | double | h, |
double | s, | ||
double | v ) |
Converts an HSV color to RGB.
h | The hue. |
s | The saturation. |
v | The value. |
int lerp_color | ( | int | rgb1, |
int | rgb2, | ||
double | t ) |
Linearly interpolates between two colors.
rgb1 | The first color in RGB format. |
rgb2 | The second color in RGB format. |
t | The interpolation factor. |
double lerp_d | ( | double | a, |
double | b, | ||
double | t ) |
Linearly interpolates between two values.
a | The first value. |
b | The second value. |
t | The interpolation factor. |
float lerp_f | ( | float | a, |
float | b, | ||
float | t ) |
Linearly interpolates between two values.
a | The first value. |
b | The second value. |
t | The interpolation factor. |
int lerp_i | ( | int | a, |
int | b, | ||
double | t ) |
Linearly interpolates between two values.
a | The first value. |
b | The second value. |
t | The interpolation factor. |
void rgb_to_hsv | ( | int | rgb, |
double * | h, | ||
double * | s, | ||
double * | v ) |
Converts an RGB color to HSV.
rgb | The RGB color. |
h | The pointer to the hue. |
s | The pointer to the saturation. |
v | The pointer to the value. |
void sleepMillis | ( | unsigned long | millis | ) |
Pauses the program for a specified number of milliseconds.
millis | The number of milliseconds to pause. |
void sleepNanos | ( | unsigned long long | nanos | ) |
Pauses the program for a specified number of nanoseconds.
nanos | The number of nanoseconds to pause. |