-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.c
More file actions
39 lines (35 loc) · 1 KB
/
example.c
File metadata and controls
39 lines (35 loc) · 1 KB
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
#include "dump.h"
#define Vec2_FIELDS(X) \
X(uint32_t, x) \
X(uint32_t, y)
DECLARE_STRUCT(Vec2);
typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
} Color;
#define Square_FIELDS(X) \
X(Vec2 *, position) \
X(Color, color) \
X(float, rotation) \
X(const float, size)
DECLARE_STRUCT(Square);
int main() {
Vec2 pos = {69, 420};
Square square = {&pos, {}, 3.14f / 2, 20};
DUMP(square, Square);
/*
example.c:25
square(Square): {
position(Vec2 *): {
x(uint32_t): 69
y(uint32_t): 420
}
color(Color): <unknown>
rotation(float): 1.570000
size(const float): 20.000000
}
*/
return 0;
}