MTek-GDL 0.100.4-muffintrap
Loading...
Searching...
No Matches
mgdl-util.h
1#pragma once
2
3#include <mgdl/mgdl-types.h>
4#include <mgdl/mgdl-opengl.h>
5#include <stdarg.h>
6#include <string.h>
7// helper functions
8
9
10#ifdef __cplusplus
11extern "C"
12{
13#endif
14
15void Random_CreateGenerator(void);
16void Random_SetSeed(u32 seed);
17float Random_Float(float min, float max);
18float Random_FloatNormalized(void);
19int Random_Int(int min, int max);
20
21u32 clampU32(u32 val, u32 minVal, u32 maxVal);
22float clampF(float val, float minVal, float maxVal);
23float minF(float a, float b);
24float maxF(float a, float b);
25u32 minU32(u32 a, u32 b);
26u32 maxU32(u32 a, u32 b);
27
28float Deg2Rad(float degrees);
29float Rad2Deg(float radians);
30
36GLint TextureFilterToGLFilter(TextureFilterModes filterMode);
37
38
45bool mgdl_IsFlagSet(u32 bitfield, u32 flag);
46
50char* mgdl_GetPrintfBuffer(void);
51
52#ifdef __cplusplus
53}
54#endif
55
60#define MGDL_PRINTF_TO_BUFFER(format) \
61 memset(mgdl_GetPrintfBuffer(), '\0', 256);\
62 va_list args;\
63 va_start(args, format); \
64 vsprintf(mgdl_GetPrintfBuffer(), format, args); \
65 va_end(args);\
66
67
68
Library types, macros, defines and enums header.
TextureFilterModes
Texture filter modes.
Definition mgdl-types.h:86