diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-11 23:00:26 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-11 23:00:26 +1000 |
commit | b03bde3d412148cd573f5f14012cdd270f309947 (patch) | |
tree | 848af582079a60787cc5a5f8138e7ca6d508f2ee /src/platform/platform.h | |
parent | 48a703e52490cb52fd32e54e3e37f7e70462a267 (diff) |
starting work on immediate mode drawing
Diffstat (limited to 'src/platform/platform.h')
-rw-r--r-- | src/platform/platform.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/platform/platform.h b/src/platform/platform.h new file mode 100644 index 0000000..c2be630 --- /dev/null +++ b/src/platform/platform.h @@ -0,0 +1,37 @@ +#pragma once + +#include "defines.h" +#include "str.h" + +// -- Paths +typedef struct path_opt { + Str8 path; + bool has_value; +} path_opt; + +// TODO: convert to using str8 +// TODO: use uppercase code style +path_opt path_parent(arena* a, const char* path); + +// --- Threads +typedef struct CelThread CelThread; + +CelThread Thread_Create(); +void Thread_Destroy(CelThread* thread); + +// --- Mutexes +typedef struct CelMutex CelMutex; + +CelMutex Mutex_Create(); +void Mutex_Destroy(CelMutex* mutex); + +/** @brief Blocks until the mutex can be acquired. if returns false then an error occurred and can + * be checked (TODO) */ +bool Mutex_Lock(CelMutex* mutex); + +/** @brief Tries to acquire the mutex like `mutex_lock` but returns immediately if the mutex has + * already been locked */ +bool Mutex_TryLock(CelMutex* mutex); + +/** @brief Releases a mutex. If it is already unlocked then does nothing */ +void Mutex_Unlock(CelMutex* mutex); |