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
- Font loading
- Measuring for formatting & justification
- Utf8 Glyph walking
- Commented example in oogabooga/examples/text_rendering.c
- Small 2D renderer refactor
- Pass 8-bit integers "type" and "sampler_index" to shader
- Sample texture differently depending on "type" (text or regular quad)
- Sample with nearest/linear min/mag depending on sampler_index
- Set min/mag filtering in Draw_Quad
- Images are now created and deleted directly with gfx calls rather than deferring it for gfx_update.
- We can now set image sub data with gfx_set_image_data()
- Images are no longer hard coded to 4 channels
- Utf8 utility:
- utf8_to_utf32(): convert utf8 bytes to a single u32 codepoint
- next_utf8(): Convert first utf8 character in a string to a u32 codepoint and advance the passed string to the next unicode
- Renamed m4_multiply -> m4_mul for consistency
- Refactored os window to be DPI aware (scaled_width vs pixel_width)
- in minimal example, renamed hammer_xform -> rect_xform
- Added asserts to make sure we detect similar bugs faster
- Made simd shippable & configurable
- Some documentation in oogabooga.c on configuration
- Very optimized release build script
- Cleaned some stuff up
- cpu.c to query cpu capabilities and intrinsics
- In init, find best available simd instruction sets and assign simd function ptrs accordingly.
- Replace basic vector arithmetic procs with simd implementations
- Refactor drawing to keep blocks persistent in memory
- Make string usage easier & more consisten (macros for string vs const char*)
- rdtsc intrinsic (get cycle count)
- Profiling macros (generates a google trace json)
- Write D3D11 debug messages to stdout
- String_Builder & thorough tests for it
- I didn't get rotation going quite right with the xform, but it's 2am goodnight
- Smashed my head and had bad thoughts about microsoft many times
- stuff
- lotsa example code in entry.c
- Jai-like print procedures
- %s formats 'string' and to format a char* you do %cs
- It detects if %cs pointer is outside of program memory or stack and asserts
- AND same for if a char* is passed to %s
- Print directly writes to stdout without any allocations
- Basic utlity procedures
- Buncha string tests
- Beef up assert to display file & line as well
- Don't define memcpy procedures if compiler has intrinsics for them
- Init memory arena for allocations in initialization time before heap is ready (stack memory)
- os_compare_and_swap
- Spinlock "primitive" (wrapper around a bool using compare_and_swap)
- Switched to using spinlock instead of os mutex in heap for synchronization.
- is_pointer_valid() which checks if address is in program_memory or thread stack
- Dyamically load minimum crt symbols in os backend so we don't need to #include c headers
- Some more os calls:
- write to stdout (with our string type)
- macros for variadic argument lists
- Dynamic library loading
- Some compile options that make sense for build.bat, and a build_release.bat
- oogabooga:
- Big buffer program_memory that always has same base address (goodbye serialisation problems)
- Big buffer grows as needed, crash when out of memory
- Very sexy platform abstraction & basic os call procedures
- Heap allocator around the program memory.
- Jaiyfication (context, context.allocator, push_allocator, temp allocator)
- Some tests to make sure we ooga the right boogas