Since crash() stops the program, adding the `noreturn` attribute allows the compiler to optimize in certain cases. CLion and ReSharper also use this in its static analysis engine to warn about unreachable code. Additionally, since `assert()` uses `crash()` if the checked pointer is null, this lets the analysis engine correctly discern that the pointer will in fact not be null and stop erroneous null pointer warnings.
Audio sources & decoding are pretty much done and working well.
Playback is not really implemented yet, I'm just hacking in a way to output an audio source.
- Seriously microsoft wtf
Concurrency:
- Refactored spinlock out of OS api (deprecated old procs)
- Concurrency utilites:
void spinlock_init(Spinlock *l);
void spinlock_acquire_or_wait(Spinlock* l);
bool spinlock_acquire_or_wait_timeout(Spinlock* l, f64 timeout_seconds);
void spinlock_release(Spinlock* l);
void mutex_init(Mutex *m);
void mutex_destroy(Mutex *m);
void mutex_acquire_or_wait(Mutex *m);
void mutex_release(Mutex *m);
void binary_semaphore_init(Binary_Semaphore *sem, bool initial_state);
void binary_semaphore_destroy(Binary_Semaphore *sem);
void binary_semaphore_wait(Binary_Semaphore *sem);
void binary_semaphore_signal(Binary_Semaphore *sem);
Macro MEMORY_BARRIER
- Concurrency tests
Docs:
- custom_logger.c example to show how one can make a custom logger and have logs displayed in-game
Utility:
- draw_text_and_measure() which is just an overload of draw_text but it also does a measure and returns it
Misc:
- Added u64 thread_id to global context. This is set in main() for main thread and in thread startup when you dispatch a Thread
- Fixed a bug where plain rects would be drawn with the incorrect color
- Fixed a bug where quads from earlier frames would be drawn
- Improved assert messages to be more clear about what might be happening if they fail
- Added more checks in debug to detect heap corruption and what not
- Fixed a bug where the program would crash because a heap block was perfectly full
- Fixed Y placement of window when changing the window rect
- Fixed window sizing when setting scaled_width or scaled_height
- Updated readme
- Improved assert messages to be more clear about what might be happening if they fail
- Added more checks in debug to detect heap corruption and what not
- Fixed a bug where the program would crash because a heap block was perfectly full
- Fixed Y placement of window when changing the window rect
- Fixed window sizing when setting scaled_width or scaled_height
- Updated readme