diff options
| author | realtradam <[email protected]> | 2023-06-16 01:15:57 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-06-16 01:15:57 -0400 |
| commit | 94625b3133193acd22b68595fe922b7228528b11 (patch) | |
| tree | f7e358545f5043df20695d0cf51dcf8caa10cb12 /include/rodeo | |
| parent | acc9db32d765728b63162d6fc74a278d0da10b83 (diff) | |
| download | RodeoKit-matrixtemp.tar.gz RodeoKit-matrixtemp.zip | |
fix matrix wrapper as well as a lot of refactoring cleanupmatrixtemp
Diffstat (limited to 'include/rodeo')
| -rw-r--r-- | include/rodeo/gfx_t.h | 4 | ||||
| -rw-r--r-- | include/rodeo/math.h | 1 | ||||
| -rw-r--r-- | include/rodeo/math/mat4_t.h | 1 | ||||
| -rw-r--r-- | include/rodeo/math/rng.h | 48 | ||||
| -rw-r--r-- | include/rodeo/math/rng_t.h | 16 | ||||
| -rw-r--r-- | include/rodeo/math/vec2_t.h | 8 | ||||
| -rw-r--r-- | include/rodeo/math/vec3_t.h | 8 | ||||
| -rw-r--r-- | include/rodeo/window.h | 4 |
8 files changed, 85 insertions, 5 deletions
diff --git a/include/rodeo/gfx_t.h b/include/rodeo/gfx_t.h index 9ed5f14..40ea58c 100644 --- a/include/rodeo/gfx_t.h +++ b/include/rodeo/gfx_t.h @@ -6,12 +6,12 @@ // -- system -- #include <inttypes.h> -typedef struct irodeo_gfx_texture_internal irodeo_gfx_texture_internal_t; +typedef struct irodeo_gfx_texture_2d irodeo_gfx_texture_2d_t; typedef struct { - irodeo_gfx_texture_internal_t *internal_texture; + irodeo_gfx_texture_2d_t *data; uint32_t width; uint32_t height; } diff --git a/include/rodeo/math.h b/include/rodeo/math.h index 39e9c26..3896fef 100644 --- a/include/rodeo/math.h +++ b/include/rodeo/math.h @@ -6,6 +6,7 @@ #include "rodeo/math/vec2.h" #include "rodeo/math/vec3.h" #include "rodeo/math/mat4.h" +#include "rodeo/math/rng.h" #define mrodeo_math_pi 3.1415927410125732421875f diff --git a/include/rodeo/math/mat4_t.h b/include/rodeo/math/mat4_t.h index 2893444..e00656c 100644 --- a/include/rodeo/math/mat4_t.h +++ b/include/rodeo/math/mat4_t.h @@ -1,6 +1,5 @@ #pragma once - typedef struct { diff --git a/include/rodeo/math/rng.h b/include/rodeo/math/rng.h new file mode 100644 index 0000000..53f1f76 --- /dev/null +++ b/include/rodeo/math/rng.h @@ -0,0 +1,48 @@ +#pragma once + +// -- internal -- +#include "rodeo/math/rng_t.h" + +// -- system -- +#include <inttypes.h> + +void +rodeo_math_rng_init(void); + +void +rodeo_math_rng_deinit(void); + +rodeo_math_rng_generator_t +rodeo_math_rng_generator_create(uint64_t seed); + +void +rodeo_math_rng_generator_destroy(rodeo_math_rng_generator_t generator); + +double +rodeo_math_rng_double_get(rodeo_math_rng_generator_t generator); + +#define irodeo_math_rng_double_get_default() rodeo_math_rng_double_get((rodeo_math_rng_generator_t){0}) + +float +rodeo_math_rng_float_get(rodeo_math_rng_generator_t generator); + +#define irodeo_math_rng_float_get_default() rodeo_math_rng_float_get((rodeo_math_rng_generator_t){0}) + +uint64_t +rodeo_math_rng_uint64_get(rodeo_math_rng_generator_t generator); + +#define irodeo_math_rng_uint64_get_default() rodeo_math_rng_uint64_get((rodeo_math_rng_generator_t){0}) + +uint32_t +rodeo_math_rng_uint32_get(rodeo_math_rng_generator_t generator); + +#define irodeo_math_rng_uint32_get_default() rodeo_math_rng_uint32_get((rodeo_math_rng_generator_t){0}) + +#define \ +mrodeo_math_rng_do( \ +) \ + mrodeo_defer_do( \ + rodeo_math_rng_init(), \ + rodeo_math_rng_deinit() \ + ) + diff --git a/include/rodeo/math/rng_t.h b/include/rodeo/math/rng_t.h new file mode 100644 index 0000000..8c527ed --- /dev/null +++ b/include/rodeo/math/rng_t.h @@ -0,0 +1,16 @@ +#pragma once + +// -- system -- +#include <inttypes.h> + +typedef struct irodeo_math_rng_generator irodeo_math_rng_generator_t; + +typedef +struct +{ + // note: a seed value of '0' is reserved for when using the + // global seed is desired. + uint64_t seed; + irodeo_math_rng_generator_t *data; +} +rodeo_math_rng_generator_t; diff --git a/include/rodeo/math/vec2_t.h b/include/rodeo/math/vec2_t.h index 61b941e..22717c6 100644 --- a/include/rodeo/math/vec2_t.h +++ b/include/rodeo/math/vec2_t.h @@ -6,4 +6,12 @@ struct float x; float y; } +rodeo_math_vec2_val_t; + +typedef +union +{ + rodeo_math_vec2_val_t val; + float raw[2]; +} rodeo_math_vec2_t; diff --git a/include/rodeo/math/vec3_t.h b/include/rodeo/math/vec3_t.h index 711ad98..a3b3a36 100644 --- a/include/rodeo/math/vec3_t.h +++ b/include/rodeo/math/vec3_t.h @@ -7,4 +7,12 @@ struct float y; float z; } +rodeo_math_vec3_val_t; + +typedef +union +{ + rodeo_math_vec3_val_t val; + float raw[3]; +} rodeo_math_vec3_t; diff --git a/include/rodeo/window.h b/include/rodeo/window.h index 2dcfab2..df73b4f 100644 --- a/include/rodeo/window.h +++ b/include/rodeo/window.h @@ -13,8 +13,8 @@ void rodeo_window_init( - uint16_t screen_height, - uint16_t screen_width, + uint32_t screen_height, + uint32_t screen_width, cstr title ); |
