forked from scallyw4g/bonsai_stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bonsai_stdlib.h
116 lines (92 loc) · 3.16 KB
/
bonsai_stdlib.h
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
#define poof(...)
// NOTE(Jesse): This is strictly present to hack around some deficiencies in
// poof. It should be removed in the future.
#include <bonsai_stdlib/src/poof_crutches.h>
#include <bonsai_stdlib/src/poof_functions.h>
#include <bonsai_stdlib/src/iterators.h>
#include <bonsai_stdlib/src/assert.h>
#include <bonsai_stdlib/src/primitives.h>
#include <bonsai_stdlib/src/console_macros.h>
#include <bonsai_stdlib/src/globals.h>
#include <bonsai_stdlib/src/platform.h>
#include <bonsai_stdlib/src/bit_tricks.h>
#include <bonsai_stdlib/src/atomic.h>
#include <bonsai_stdlib/src/thread.h>
#include <bonsai_stdlib/src/math.h>
#include <bonsai_stdlib/src/memory_arena.h>
#include <bonsai_stdlib/src/primitive_containers.h>
#include <bonsai_stdlib/src/file.h>
#include <bonsai_stdlib/src/filesystem.h>
#include <bonsai_stdlib/src/vector.h>
#include <bonsai_stdlib/src/matrix.h>
#include <bonsai_stdlib/src/colors.h>
#include <bonsai_stdlib/src/texture.h>
#include <bonsai_stdlib/src/shader.h>
#include <bonsai_stdlib/src/random.h>
#include <bonsai_stdlib/src/noise.h>
#include <bonsai_stdlib/src/perlin.h>
#include <bonsai_stdlib/src/simplex.h>
#include <bonsai_stdlib/src/input.h>
#include <bonsai_stdlib/src/mutex.h>
#include <bonsai_stdlib/src/work_queue.h>
#include <bonsai_stdlib/src/mesh.h>
#include <bonsai_stdlib/src/gl.h>
#include <bonsai_stdlib/src/ui/gl.h>
#include <bonsai_stdlib/src/platform_struct.h>
#include <bonsai_stdlib/src/heap_allocator.h>
#include <bonsai_stdlib/src/stream.h>
#include <bonsai_stdlib/src/counted_string.h>
#include <bonsai_stdlib/src/sort.h>
#include <bonsai_stdlib/src/console_io.h>
#include <bonsai_stdlib/src/line.h>
#include <bonsai_stdlib/src/quaternion.h>
#include <bonsai_stdlib/src/string_builder.h>
#include <bonsai_stdlib/src/ansi_stream.h>
#include <bonsai_stdlib/src/rect.h>
#include <bonsai_stdlib/src/xml.h>
#include <bonsai_stdlib/src/geometry_buffer.h>
struct light;
struct camera;
#include <bonsai_stdlib/src/ui/interactable.h>
#include <bonsai_stdlib/src/ui/ui.h>
#include <bonsai_stdlib/src/c_token.h>
#include <bonsai_stdlib/src/c_parser.h>
#include <bonsai_stdlib/src/debug_ui.h>
#if BONSAI_DEBUG_SYSTEM_API
#include <bonsai_debug/debug.h>
#include <bonsai_debug/src/api.h>
#else
struct bonsai_debug_system {};
#define TIMED_FUNCTION(...)
#define TIMED_NAMED_BLOCK(...)
#define HISTOGRAM_FUNCTION(...)
#define TIMED_BLOCK(...)
#define END_BLOCK(...)
#define DEBUG_VALUE(...)
#define TIMED_MUTEX_WAITING(...)
#define TIMED_MUTEX_AQUIRED(...)
#define TIMED_MUTEX_RELEASED(...)
#define DEBUG_FRAME_RECORD(...)
#define DEBUG_FRAME_END(...)
#define DEBUG_FRAME_BEGIN(...)
#define WORKER_THREAD_WAIT_FOR_DEBUG_SYSTEM(...)
#define MAIN_THREAD_ADVANCE_DEBUG_SYSTEM(...)
#define WORKER_THREAD_ADVANCE_DEBUG_SYSTEM()
#define DEBUG_CLEAR_META_RECORDS_FOR(...)
#define DEBUG_TRACK_DRAW_CALL(...)
#endif
#define UNPACK_STDLIB(Stdlib) \
os *Os = &(Stdlib)->Os; \
platform *Plat = &(Stdlib)->Plat;
struct bonsai_stdlib
{
os Os;
platform Plat;
thread_local_state *ThreadStates;
//
// Debug
//
texture_block_array AllTextures;
bonsai_debug_system DebugSystem;
};
link_weak bonsai_stdlib *GetStdlib();