Commit graph

70 commits

Author SHA1 Message Date
Charlie
a9cbf7ee68 Hotfixes & try to fix window sizing but fail miserably 2024-07-09 19:53:26 +02:00
Charlie
52f68d5fe2 Shader hotfix 2024-07-09 19:17:31 +02:00
Charlie
380d52c9fc Shader hotfix 2024-07-09 19:16:54 +02:00
Charlie
cc74dc68e4 ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? 2024-07-09 18:51:15 +02:00
Charlie
b37652e1ce v0.00.004 - Custom logging, more concurrency & bugfixing
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
2024-07-09 18:38:06 +02:00
Charlie
720b545d41 Hotfix build.c 2024-07-09 14:54:06 +02:00
randy
36c6ff5589 added range.c 2024-07-09 18:40:48 +07:00
Charlie
9842834065 - Portable DEPRECATED macro
- Deprecate os_compare_and_swap and replace with more portable compare_and_swap
- Fixed a bug where the wrong image would be drawn
2024-07-09 09:16:09 +02:00
Charlie
e54897432b Fixed memory bug & window placement
- 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
2024-07-09 09:15:35 +02:00
Charlie
05fd88472b Fix merge conflicts 2024-07-09 09:13:44 +02:00
Charlie
2955642477 Dev mode 2024-07-09 09:12:10 +02:00
Charlie
cc8d186dc3 - Portable DEPRECATED macro
- Deprecate os_compare_and_swap and replace with more portable compare_and_swap
- Fixed a bug where the wrong image would be drawn
2024-07-09 09:07:30 +02:00
Charlie
a805557a76 Fixed memory bug & window placement
- 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
2024-07-08 17:57:23 +02:00
Charlie
aee3f78bd5 Add minimal libraries for decoding audio 2024-07-08 15:33:01 +02:00
randy
81133fe9c3 removed randygame from build 2024-07-08 18:40:17 +07:00
randy
f87943a6de moved randygame stuff into fork
I'm no longer using this repo, so it can be less cluttered. I'm working in my own fork now.
2024-07-08 18:20:46 +07:00
randy
339d690627 day 3
- entity structure
- SpriteID
- generic sprite entity rendering
2024-07-08 15:33:42 +07:00
randy
9ebd7fa7eb random in range func 2024-07-08 15:32:03 +07:00
Charlie
21482f2df2 Dev mode 2024-07-07 20:46:57 +02:00
Charlie
8d081c1afe Merge branch 'dev' 2024-07-07 20:45:45 +02:00
Charlie
3d781e0bd1 v0.00.002 - Text rendering, image manipulation, hash tables 2024-07-07 20:44:40 +02:00
Charlie
18f4fc8123 - Text rendering
- 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
2024-07-07 20:27:34 +02:00
Charlie
83c0371dcb Rework Gfx_Image stuff 2024-07-07 09:09:01 +02:00
Charlie
ebaa52c326 Naive hash table & tests 2024-07-06 15:50:16 +02:00
randy
4e900b0121
Update README.md 2024-07-05 11:45:07 +07:00
randy
7e09bef412
Update README.md 2024-07-05 10:05:53 +07:00
randy
d69532146d readme 2024-07-05 08:20:31 +07:00
randy
711f9c9010 educational license 2024-07-05 06:54:09 +07:00
Charlie
05919248eb - Replace lodepng with stb_image (& add stb_truetype for fonts)
- Fix d3d11 Input assembler not being created correctly bug
- Fix framerate being locked by swap chain present
- Move enable_vsync to window
- sqrt & rsqrt simd
- Add release build & run in vscode tasks & launch
- Cleanup
2024-07-04 20:56:27 +02:00
Charlie
4c5f882999 Fixy smixy 2024-07-04 12:19:51 +02:00
Charlie
5db73b90e9 Fixy smixy 2024-07-04 12:18:16 +02:00
Charlie
439f00caf4 Merge 2024-07-04 12:13:40 +02:00
randy
6134c6e982 build project swap example (volatile with tutorial) 2024-07-04 10:20:35 +07:00
randy
1d33a0e4e6 included workspace for easier setup 2024-07-04 09:37:04 +07:00
randy
1fba52ad7a commit .vscode for easier setup 2024-07-04 09:35:03 +07:00
randy
0fad72aa09 build_clang -> build 2024-07-04 09:21:39 +07:00
Charlie
546f8af3d4 - Fixed bug in ALLOCATOR_REALLOC corrupting memory/returning invalid address
- 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
2024-07-03 17:55:25 +02:00
randy
238be066ba entity megastruct init 2024-07-03 17:56:19 +07:00
Charlie
b07c2f3160 Simplify simd 2024-07-03 11:21:48 +02:00
randy
82ada8e9e0 lesson2, projection & view settings 2024-07-03 12:40:21 +07:00
Charlie
aceadf4aca Fix simd & Vector oopsies + lots of tests 2024-07-03 00:41:52 +02:00
Charlie
e52e1a403e I got very sidetracked.
- 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
2024-07-03 00:01:11 +02:00
Charlie
1f2809d23e Ooga'd some boogas 2024-07-02 19:12:31 +02:00
Charlie
b15c7c6e41 - Fixed D3D11 eating 40000000 cycles for no reason (Thank you Bill Gates)
- 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
2024-07-02 15:27:33 +02:00
randy
6519955513 v2_normalize 2024-07-02 14:38:17 +07:00
randy
69d8f66e22 basic player move init, lesson #1 2024-07-02 14:36:47 +07:00
randy
9866eae1b8 project swapping setup 2024-07-02 12:48:28 +07:00
randy
f66e89087e color.c utils 2024-07-02 12:48:05 +07:00
randy
b2758db850 entry -> test_game 2024-07-02 11:32:21 +07:00
randy
d916c86995 removed CL builds 2024-07-02 10:56:00 +07:00