forked from alpinestudios/oogabooga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changelog.txt
353 lines (312 loc) · 14.4 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
## 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