diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/compile_flags.txt | 11 | ||||
| -rw-r--r-- | include/rodeo.h | 30 | ||||
| -rw-r--r-- | include/rodeo/common.h | 20 | ||||
| -rw-r--r-- | include/rodeo/log.h | 11 | ||||
| -rw-r--r-- | include/rodeo/log_t.h | 40 | ||||
| -rw-r--r-- | include/rodeo_types.h | 41 |
6 files changed, 87 insertions, 66 deletions
diff --git a/include/compile_flags.txt b/include/compile_flags.txt new file mode 100644 index 0000000..2c81d8a --- /dev/null +++ b/include/compile_flags.txt @@ -0,0 +1,11 @@ +-I./ +-I../include +-I../external/SDL/include +-I../external/bgfx/include +-I../external/bx/include +-I../external/cglm/include +-I../external/STC/include +-Wall +-Wextra +-Wpedantic +-Wconversion diff --git a/include/rodeo.h b/include/rodeo.h index 1fd27a6..2d43ce0 100644 --- a/include/rodeo.h +++ b/include/rodeo.h @@ -2,6 +2,9 @@ // -- internal -- // public #include "rodeo_types.h" +#include "rodeo/input.h" +#include "rodeo/log.h" +#include "rodeo/common.h" // -- external -- #include "stc/cstr.h" @@ -14,25 +17,6 @@ #include <string.h> #include <limits.h> -#define mrodeo_name_concat(prefix, suffix) prefix##suffix - -#define mrodeo_macrovar(prefix) mrodeo_name_concat(prefix##_, __LINE__) - -#define mrodeo_defer_do(start, end) \ - for( \ - int mrodeo_macrovar(_macrovar_) = (start, 0); \ - !mrodeo_macrovar(_macrovar_); \ - (mrodeo_macrovar(_macrovar_) += 1), end \ - ) \ - -#define \ -mrodeo_vargs_do(final_arg) \ - va_list vargs; \ - mrodeo_defer_do( \ - va_start(vargs, final_arg), \ - va_end(vargs) \ - ) \ - /// --- Math --- rodeo_color_RGBA8_t @@ -148,14 +132,6 @@ rodeo_texture_2d_draw( const rodeo_texture_2d_t *texture ); -/// --- Log --- - -void -rodeo_log( - rodeo_logLevel_t loglevel, - const char *format, - ... -); /// --- Framerate --- diff --git a/include/rodeo/common.h b/include/rodeo/common.h new file mode 100644 index 0000000..886a82c --- /dev/null +++ b/include/rodeo/common.h @@ -0,0 +1,20 @@ + +#define mrodeo_name_concat(prefix, suffix) prefix##suffix + +#define mrodeo_macrovar(prefix) mrodeo_name_concat(prefix##_, __LINE__) + +#define mrodeo_defer_do(start, end) \ + for( \ + int mrodeo_macrovar(_macrovar_) = (start, 0); \ + !mrodeo_macrovar(_macrovar_); \ + (mrodeo_macrovar(_macrovar_) += 1), end \ + ) \ + +#define \ +mrodeo_vargs_do(final_arg) \ + va_list vargs; \ + mrodeo_defer_do( \ + va_start(vargs, final_arg), \ + va_end(vargs) \ + ) \ + diff --git a/include/rodeo/log.h b/include/rodeo/log.h new file mode 100644 index 0000000..837e795 --- /dev/null +++ b/include/rodeo/log.h @@ -0,0 +1,11 @@ + +// -- internal -- +// public +#include "rodeo/log_t.h" + +void +rodeo_log( + rodeo_logLevel_t loglevel, + const char *format, + ... +); diff --git a/include/rodeo/log_t.h b/include/rodeo/log_t.h new file mode 100644 index 0000000..844601a --- /dev/null +++ b/include/rodeo/log_t.h @@ -0,0 +1,40 @@ +#pragma once + +// -- external -- +#include "stc/cstr.h" + +typedef +enum +{ + rodeo_logLevel_info, + rodeo_logLevel_warning, + rodeo_logLevel_error +} +rodeo_logLevel_t; + +typedef +void +(*rodeo_log_function)(cstr text); + +typedef +union +{ + struct { + float x; + float y; + }; + float array[2]; +} +rodeo_vector2_t; + +typedef +union +{ + struct { + float x; + float y; + float z; + }; + float array[3]; +} +rodeo_vector3_t; diff --git a/include/rodeo_types.h b/include/rodeo_types.h index 4ed7767..bc92fb4 100644 --- a/include/rodeo_types.h +++ b/include/rodeo_types.h @@ -1,9 +1,9 @@ #pragma once -// external +// -- external -- #include "stc/cstr.h" -// system +// -- system -- #include <stdbool.h> #include <stdint.h> #include <stddef.h> @@ -89,40 +89,3 @@ typedef struct rodeo_frameBuffer_2d_t; */ -/// --- Log --- - -typedef -enum -{ - rodeo_logLevel_info, - rodeo_logLevel_warning, - rodeo_logLevel_error -} -rodeo_logLevel_t; - -typedef -void -(*rodeo_log_function)(cstr text); - -typedef -union -{ - struct { - float x; - float y; - }; - float array[2]; -} -rodeo_vector2_t; - -typedef -union -{ - struct { - float x; - float y; - float z; - }; - float array[3]; -} -rodeo_vector3_t; |
