-
Notifications
You must be signed in to change notification settings - Fork 239
/
Copy pathchangelog.txt
551 lines (487 loc) · 24.6 KB
/
changelog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
## v0.01.009 - Better shaders & Audio fixes
- Audio
- Improved spacialization API
- renamed Audio_Playback_Config.position_ndc -> Audio_Playback_Config.position
- Added Audio_Playback_Config spacial_projection & spacial_listener_xform
- Audio_Playback_Config.position can now be in your world space
- spacial_projection & spacial_listener_xform is the same as Draw_Frame.projection & Draw_Frame.camera_xform but for the audio spacialization
- Refactored audio a bit to get its intermediate buffers from one large mega buffer
- Fixed the short fade in/out on pausing/playing without noise
- Added audio_player_transition_to_source() which makes a player fade to another source for a given amount of seconds
- Graphics
- Reworked shader extension system so you can make multiple Gfx_Shader_Extension and use them per Draw_Frame render.
- gfx_destroy_shader_extension()
- gfx_compile_shader_extension()
- Added Draw_Frame.shader_extension (which you set before gfx_render_draw_frame for it to be used)
Not setting this or setting it to {0} means default shader is used.
- Added draw_frame_bind_image_to_shader()
We can now directly bind an image to a hlsl texture slot that we can sample from
- Made examples/bloom.c example which shows how you can do post-processing effects like bloom.
- Fixed a bug where the window would maximize to fill all monitors rather than the current one
- Fixed a bug where when more than 32 images were used in the same Draw_Frame, the wrong textures would start getting drawn.
- Misc
- Added parsing functions string_to_int and string_to_float
- Fixed Vector(N)64's to actually use float64's instead of float32's (whoops)
- VERTEX_2D_USER_DATA_COUNT -> VERTEX_USER_DATA_COUNT
- Minor refactors, cleanup, bugfixes
## v0.01.008 - hotfix
- Unbroke gfx_reserve_vbo_bytes
## v0.01.007 - Offscreen rendering, Draw_Frame's, Major reworks, more examples
- Graphics
- Implemented render-target versions of Gfx_Image
- Added functions for offscreen rendering:
- make_image_render_target()
- gfx_render_draw_frame(Draw_Frame, Gfx_Image*)
- (and gfx_render_draw_frame_to_window(Draw_Frame) to render draw_frame directly to window)
See examples/offscreen_drawing.c for a practical example.
- Reworked the Draw_Frame's & drawing API
- Instead of targetting the global draw_frame, all drawing functions now make a call to draw_xxx_in_frame and passes &draw_frame as the last parameter.
- So, we added draw_xxx_in_frame overloads which means we can now draw to other Draw_Frame's than the global one.
- While the global draw_frame is still reset & rendered in gfx_update(), we can now manage separate draw_frame's manually with:
void draw_frame_init(Draw_Frame *frame);
void draw_frame_init_reserve(Draw_Frame *frame, u64 number_of_quads_to_reserve);
void draw_frame_reset(Draw_Frame *frame);
- See examples/threaded_drawing.c which dedicates a Draw_Frame to each thread to split up the drawing, and then render them on the main thread.
- Complete list of new drawing API functions:
void draw_frame_init(Draw_Frame *frame);
void draw_frame_init_reserve(Draw_Frame *frame, u64 number_of_quads_to_reserve);
void draw_frame_reset(Draw_Frame *frame);
Draw_Quad *draw_quad_projected_in_frame(Draw_Quad quad, Matrix4 world_to_clip, Draw_Frame *frame);
Draw_Quad *draw_quad_in_frame(Draw_Quad quad, Draw_Frame *frame);
Draw_Quad *draw_quad_xform_in_frame(Draw_Quad quad, Matrix4 xform, Draw_Frame *frame);
Draw_Quad *draw_rect_in_frame(Vector2 position, Vector2 size, Vector4 color, Draw_Frame *frame);
Draw_Quad *draw_rect_xform_in_frame(Matrix4 xform, Vector2 size, Vector4 color, Draw_Frame *frame);
Draw_Quad *draw_circle_in_frame(Vector2 position, Vector2 size, Vector4 color, Draw_Frame *frame);
Draw_Quad *draw_circle_xform_in_frame(Matrix4 xform, Vector2 size, Vector4 color, Draw_Frame *frame);
Draw_Quad *draw_image_in_frame(Gfx_Image *image, Vector2 position, Vector2 size, Vector4 color, Draw_Frame *frame);
Draw_Quad *draw_image_xform_in_frame(Gfx_Image *image, Matrix4 xform, Vector2 size, Vector4 color, Draw_Frame *frame);
void draw_line_in_frame(Vector2 p0, Vector2 p1, float line_width, Vector4 color, Draw_Frame *frame);
void draw_text_xform_in_frame(Gfx_Font *font, string text, u32 raster_height, Matrix4 xform, Vector2 scale, Vector4 color, Draw_Frame *frame);
void draw_text_in_frame(Gfx_Font *font, string text, u32 raster_height, Vector2 position, Vector2 scale, Vector4 color, Draw_Frame *frame);
Gfx_Text_Metrics draw_text_and_measure_in_frame(Gfx_Font *font, string text, u32 raster_height, Vector2 position, Vector2 scale, Vector4 color, Draw_Frame *frame);
void push_z_layer_in_frame(s32 z, Draw_Frame *frame);
void pop_z_layer_in_frame(Draw_Frame *frame);
void push_window_scissor_in_frame(Vector2 min, Vector2 max, Draw_Frame *frame);
void pop_window_scissor_in_frame(Draw_Frame *frame);
- Added gfx_reserve_vbo_bytes so you can allocate a big vbo once instead of slowly doubling it, causing lag spikes
- Renamed shader_recompile_with_extension -> gfx_shader_recompile_with_extension
- Sped up d3d11 renderer a bit with index buffer
- More thoroughly documented drawing.c
- Made window resizing forced to be even (% 2 == 0), because uneven dimensions make texture sampling wonky and I'm not sure how to solve it
- OS
- Reworked window stuff
- Reworked window sizing & positioning
- Deprecated window.scaled_width & window.scaled_height to be replaced by window.point_width and window.point_height which is units in 72th of an inch
- Added window.point_x and window.point_y
- Added window.dpi and window.points_size_in_pixels
- Fixed window positioning and sizing, as it was pretty broken and incorrect before
- Added an examples that showcase all the window stuff in examples/window_test.c
- Added window.force_topmost for forcing the window to be on top of everything when true.
- Told windows to gtfo and let us size and position the window however we want
- Binary semaphore:
os_binary_semaphore_init(Binary_Semaphore *sem, bool initial_state);
os_binary_semaphore_destroy(Binary_Semaphore *sem);
os_binary_semaphore_wait(Binary_Semaphore *sem);
os_binary_semaphore_signal(Binary_Semaphore *sem);
- Misc
- Reworked linmath
- There are now 4(x3) different vector types: VectorNf32, VectorNf64, VectorNs32, VectorNs64 where N is the number of scalars from 2 to 4.
- The code has been refactored to be more consistent, predictable and self-documenting
- Vector2 and Vector2i as well as v2_ and v2i_ functions are typedeffed / #defined to Vector2f32 and Vector2s32
- Vector interpolation functions:
v2_lerp
v3_lerp
v4_lerp
v2_smerp
v3_smerp
v4_smerp
- Changed profiling to measure in seconds
- lerpf -> lerpf32 & lerpf64
- smerpf -> smerpf32 & smerpf64
- Changed default ortho projection to match window size
- Made oogabooga init seed_for_random to rdtsc() so each program starts completely randomized
- Cleanups
## v0.01.006 - Particles, Matrix3, extensions
- Build configuration
- Introduced an "extensions" system to be able to compile some extensions that might help with your game.
- To enable extensions, do #define OOGABOOGA_ENABLE_EXTENSIONS 1, then #define OOGABOOGA_EXTENSION_XXXXX 1
Also call ext_update(delta_time) and ext_draw() each frame.
- Implemented a Particles extension for particle emissions
- struct Emission_Config
- Emission_Handle emit_particles(config, position)
- void emission_reset(Emission_Handle h);
- void emission_set_config(Emission_Handle h, Emission_Config config);
- void emission_set_position(Emission_Handle h, Vector2 pos);
- void emission_release(Emission_Handle h);
- Misc
- Added void *growing_array_add_multiple_empty(void **array, u64 count)
- Added void growing_array_add_multiple(void **array, void *items, u64 count)
- Added Matrix3 with:
- Matrix4 m3_to_m4(Matrix3 mat3)
- Matrix3 m3_scalar(float32 scalar)
- Matrix3 m3_identity()
- Matrix3 m3_make_translation(Vector2 translation)
- Matrix3 m3_make_rotation(float32 radians)
- Matrix3 m3_make_scale(Vector2 scale)
- Matrix3 m3_mul(Matrix3 a, Matrix3 b)
- Matrix3 m3_translate(Matrix3 m, Vector2 translation)
- Matrix3 m3_rotate(Matrix3 m, float32 radians)
- Matrix3 m3_scale(Matrix3 m, Vector2 scale)
- Matrix3 m3_inverse(Matrix3 m)
- Vector3 m3_transform(Matrix3 m, Vector3 v)
- Fixed Arena so it actually works
- Fixed sys keys not being handled as expected (such as LALT)
- Added some arena procedures:
- void *arena_push(Arena *arena, u64 size)
- #define arena_push_struct(parena, type)
- Allocator make_arena_allocator_from_arena(Arena *arena)
- Cleaned up some example stuff
- Fixed build.sh
- Made seed_for_random thread_local
- Added utility function float32 sine_oscillate_n_waves_normalized(float32 v, float32 n)
- Fixed os_wait_and_read_stdin including \r\n
## v0.01.005 - Arenas, Monitor query, fullscreen
- Window
- Added bool window.fullscreen
- Added bool window.allow_resize
- Reworked window initialization
Window now starts of invisible and is made visible on first os_update().
This also gets rid of the weird window resize and reposition at startup.
- Renderer
- Added gfx_read_image_data() to read pixels from a Gfx_Image*
- Os
- Implemented access to monitor information
Os_Monitor *os.monitors
Os_Monitor *os.primary_monitor
Os_Monitor *window.monitor
u64 Os_Monitor.refresh_rate
u64 Os_Monitor.resolution_x
u64 Os_Monitor.resolution_y
u64 Os_Monitor.dpi
u64 Os_Monitor.dpi_y
string Os_Monitor.name
- Memory
- Added arenas & the arena allocator
Arena make_arena(size)
Allocator make_arena_allocator(size)
Allocator make_arena_allocator_with_memory(size, *memory)
- Misc
- Added examples/sprite_animation.c
- Removed Herobrine.
- Modified build scripts to not remove the build/ directory and instead check if it exists and if not, create it.
- Added os_wait_and_read_stdin(*result, max_count, allocator)
- Added %b format specifier for printing bools (true/false)
- Added/Improved some documentation
- Fixed some woopsies, goofs, and bugs
## v0.01.004 - Gamepad input, text wrapping, bug fixes
- Input
- Added Gamepad support
- Gamepad keycodes for buttons & clicks
- input_frame.left_stick .right_stick .left_trigger .right_trigger
- event.gamepad_index for key inputs if it's from the gamepad
- INPUT_EVENT_GAMEPAD_AXIS for same axes but in events and with the event.gamepad_index set
- Deadzone globals:
Vector2 deadzone_left_stick
Vector2 deadzone_right_stick
float32 deadzone_left_trigger
float32 deadzone_right_trigger
- Vibration
set_gamepad_vibration(float32 left, float32 right)
set_specific_gamepad_vibration(int gamepad_index, float32 left, float32 right)
- Text
- Implemented word-wrapping text into lines with
split_text_to_lines_with_wrapping()
- Added Gfx_Font_Metrics.new_line_offset for an exact value for how much you should decrement the Y on newline
- strings
- Added some utf8 helpers
utf8_index_to_byte_index()
utf8_slice()
- Added whitespace trimming helpers
string_trim() (trim right & left)
string_trim_left()
string_trim_right()
- Misc
- input_example.c
- Reworked os_get_current_time_in_seconds() -> os_get_elapsed_seconds()
Now returns seconds sincs app init.
- draw_frame.view -> draw_frame.camera_xform (deprecated .view)
- Unecessary refactoring in drawing.c
- Fixed temporary storage overflow warning (contributor @kacpercwiklinski f9bf7ff)
- Added build.sh for building on linux (contributor @0xf0adc 90f00b)
- Added linmath constants
v2_one
v3_one
v4_one
v2_zero
v3_zero
v4_zero
- Refactored get_temporary_allocator() to fallback to get_initialization_allocator() if temp_allocator is not initted
## v0.01.003 - Mouse pointers, Audio improvement & features, bug fixes
- Os layer
- Implemented setting of mouse pointers, either to system standard pointers or a custom image
os_set_mouse_pointer_standard(kind)
os_set_mouse_pointer_custom(pointer)
os_make_custom_mouse_pointer(image, width, height, hotspot_x, hotspot_y)
os_make_custom_mouse_pointer_from_file(path, hotspot_x, hotspot_y, allocator)
- Ignore SETCURSOR events unless for window resize pointer
- Store SYSTEM_INFO in init
- os_get_number_of_logical_processors()
- Renderer
- Fix bad uv sampling bug when uneven window dimensions
- Memory
- Made program_memory act more like an arena (see os_reserve_next_memory_pages() & os_unlock_program_memory_pages())
- In debug, default program memory to PAGE_NOACCESS which needs to be unlocked with os_unlock_program_memory_pages() (better crashes if we touch that memory)
- os_lock_program_memory_pages
- Heap locks pages when completely free
- Audio
- Implemented playback speed configuration
- Implemented a way to recognize audio sources which start playing at the exact same time so we can avoid phase cancellation
- Refactor playback configuration members in Audio_Player to be in a struct Audio_Playback_Configuration
Example: player.volume -> player.config.volume
- bool disable_spacialization -> bool enable_spacialization (inverted)
- Deprecated:
play_one_audio_clip_source_at_position()
play_one_audio_clip_at_position()
- Added:
play_one_audio_clip_source_with_config()
play_one_audio_clip_with_config()
- Removed 'bool retain_progression_factor' parameter in audio_player_set_source()
- Fixed a bug where players didn't loop when set to do so
- Fixed a bug where wav sources would return 4 garbage samples at the start of playback, causing a glitch in the sound
- Fixed a crash when default audio device could not be initialized
- Fixed a bunch of bugs & woopsies
- Updated audio_test.c
- Misc
- Deprecated Rangef stuff
- added peek_random()
- Updated #Contributions
- Cleaned up memory barriers in concurrency.c and use volatile instead
- Made hr fails output d3d11 debug messages before crash
- Made temporary storage size runtime-configurable for new threads
- Cleanup temporary storage after thread destroy
- Added Header checking in growing array
- Unfucked linmath alignment
## v0.01.002 - Flexible build options, Hotloading, growing array
- Build system
- We can now compile with:
OOGABOOGA_HEADLESS: No window, graphics or audio
OOGABOOGA_BUILD_SHARED_LIBRARY: Build oogabooga as a shared library (dll)
OOGABOOGA_LINK_EXTERNAL_INSTANCE: Link to an external oogabooga global state instance
- See oogabooga/examples/hotload for an example on how we can set up a project with hotloaded code
- Misc
- Better examples in custom_shader.c, & outlined circle
- Z-Sorting in the renderer is now stable
- Growing array
- oogabooga/examples/growing_array_example.c
## v0.01.001 - Spacial audio, custom shading, scissor boxing
- Audio
- Implemented spacial audio playback
Simply set player->position (it's in ndc space (-1 to 1), see audio_test.c)
Save some computation with player->disable_spacialization = true
- Added position overloads for play_one_clip
play_one_audio_clip_source_at_position(source, pos)
play_one_audio_clip_at_position(path, pos)
- Implemented volume control with player->volume
- Renderer
- Implemented custom shading
- Recompile shader with your extension to the pixel stage with
shader_recompile_with_extension(source, cbuffer_size)
- pass a buffer to the shader constant buffer at b0 with
draw_frame.cbuffer = &my_cbuffer_data
- pass userdata in the form of Vector4's
define VERTEX_2D_USER_DATA_COUNT for the amount of Vertex4 userdata's to be part of each vertex.
You can set the userdata in Draw_Quad->userdata which is a Vector4[VERTEX_2D_USER_DATA_COUNT].
See custom_shading.c example.
- Added window scissor boxing (screen space)
push_window_scissor(min, max);
pop_window_scissor();
- Added draw_circle() and draw_circle_xform in drawing.c
- Made an example for custom shading (oogabooga/examples/custom_shading.c)
- Embed default shader into codebase & always compile
- Added draw_line(p0, p1, width, color)
- Implemented culling of quads out of view
- Fixed culling bug where big rectangles that overlapped the screen but had all corners outside the screen would get culled.
- Misc
- Improved text measure and added a better explanation for it in font.c.
- Added some useful Vector procedures:
vx_length()
vx_normalize()
vx_average()
vx_dot()
vx_abs()
vx_cross()
- added os_get_file_size_from_Path()
- Some simple restructuring of existing code
- Made heap corruption detection more robust
## v0.01.000 - AUDIO!
- Added audio sources
- File stream sources & Fully decoded sources
- 16-bit int & 32-bit float support
- WAV & OGG support (in-house wav decoder, stb_vorbis for ogg)
- Usage:
bool audio_open_source_stream(*src, path, allocator)
bool audio_open_source_load(*src, path, allocator)
void audio_source_destroy(*src)
- Added audio playback
- The simple way:
play_one_audio_clip_source(source);
play_one_audio_clip(path);
- With Audio_Player:
audio_player_get_one();
audio_player_release(*player);
audio_player_set_state(*player, state);
audio_player_set_time_stamp(*player, time_in_seconds);
audio_player_set_progression_factor(*player, factor);
audio_player_get_time_stamp(*player);
audio_player_get_current_progression_factor(*player);
audio_player_set_source(*player, src, bool retain_progression_factor);
audio_player_clear_source(*player);
audio_player_set_looping(*player, bool looping);
- Added some basic features in the audio system
- Conversion & resampling between audio formats
- Automatically detects new default device
- Small fade in pause/play for less noise from sudden changes in playback buffer
- Added a audio_test.c example
- More OS procuedres
- os_file_set_pos(file, pos)
- os_file_get_pos(file)
- os_file_get_size(file)
- os_get_stack_trace(allocator)
- Misc
- Win32 audio impl
- Link to more win32 junk
- Make default logger thread safe
- Rename tm_scope_cycles & tm_scope_cycles_xxx -> tm_scope & tm_scope_xxx
- Minor cleanups
- Fix Vector types align woopsies
- Fix bug in heap allocator which caused internal heap corruption
- Maybe fixed spinlocks with memory barriers?
- Bunch of more asserts & better detection for heap allocation issues
- lerpf, lerpi, smerpf, smerpi
- Failed asserts now prints the stack trace.
## v0.00.005 - Z layers
Renderer:
- Added optional Z-sorting
- Either set quad->z or call push_z_layer(s64) (and pop_z_layer())
- Enable with draw_frame.enable_z_sorting = true
- Refactored the quad buffering to just be a growing quad buffer rather than a linked list of quad blocks. Your CPU will be thankful.
- Fixed crashing when D3D11 DEBUG flag fails in ID3D11CreateDevice, and instead log a descriptive error then continue as usual
Misc:
- removed gfx_impl_legacy_opengl.c
- Sorting procedures
- merge_sort()
- radix_sort()
- sorting tests
## 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
## v0.00.003 - Fixes
Random:
- get_random_float64()
- get_random_float32_in_range()
- get_random_float64_in_range()
- get_random_int_in_range()
Third party:
- Added 3 minimal libraries for audio decoding
- dr_mp3.h: MP3 decoding
- dr_wav.h: WAV decoding
- stb_vorbis.c: OGG decoding
- Made a global thread_local "third_party_allocator" which is set when third party libraries are used so all memory still goes through our *program_memory
- Stripped all third party libraries of external dependencies (C headers) & noise
Memory:
- 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
Misc:
- Fixed typos in examples/text_rendering.c
- Fixed Y placement of window when changing the window rect
- Fixed window sizing when setting scaled_width or scaled_height
- Updated readme
- 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
## v0.00.003 - Fixes
Random:
- get_random_float64()
- get_random_float32_in_range()
- get_random_float64_in_range()
- get_random_int_in_range()
Third party:
- Added 3 minimal libraries for audio decoding
- dr_mp3.h: MP3 decoding
- dr_wav.h: WAV decoding
- stb_vorbis.c: OGG decoding
- Made a global thread_local "third_party_allocator" which is set when third party libraries are used so all memory still goes through our *program_memory
- Stripped all third party libraries of external dependencies (C headers) & noise
Memory:
- 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
Misc:
- Fixed typos in examples/text_rendering.c
- Fixed Y placement of window when changing the window rect
- Fixed window sizing when setting scaled_width or scaled_height
- Updated readme
- 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
## v0.00.002 - Text rendering, image manipulation, hash tables
Renderer:
- 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
Text/Fonts:
- Added font loading with lazy initialization/rasterization when it's needed
- Load & rasterize any fonts with load_font_from_disk()
- Fonts automatically rasterize glyphs into atlases and generate metrics on the fly
- Measure text for very_useful metrics with measure_text()
- Walk over glyphs and their metrics with walk_glyphs()
- Implemented simple but powerful text rendering
- Draw text with draw_text() or draw_text_xform()
- See oogabooga/examples/text_rendering.c for more
Other:
- Added 3 simple hash functions:
- 64-bit xx_hash(): Very fast hash for 64-bit values
- 64-bit city_hash(): Very fast hash for short strings
- 64-bit djb2_hash(): Fast hash for strings longer than 32 bytes
- Made a generic get_hash() macro to detect the type you are trying to hash and call the approriate procedure
- Introduced a simple (kinda slow) hash table with following procedures:
- hash_table_add
- hash_table_find
- hash_table_contains
- hash_table_set
See hash_table.c for more information.
- 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
- Window now has scaled_width, scaled_height which is the DPI-scaled size. Previous window.width & window.height are now aliased as window.pixel_height and window.pixel_width for clarity
- in minimal example, renamed hammer_xform -> rect_xform