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
|
#include <stdio.h>
#include <stdbool.h>
#include "rodeo.h"
Rodeo__data_t _state = {0};
Rodeo__data_t *state = &_state;
const struct Rodeo__color_rgba_t red =
{
1.0f, 0.0f, 0.0f,
1.0f
};
const struct Rodeo__color_rgba_t green =
{
0.0f, 1.0f, 0.0f,
1.0f
};
const struct Rodeo__color_rgba_t blue =
{
0.0f, 0.0f, 1.0f,
1.0f
};
const struct Rodeo__color_rgba_t pink =
{
1.0f, 0.0f, 1.0f,
1.0f
};
int
main()
{
Rodeo__init_window(state, 480, 640, "Rodeo Window");
while(!state->quit)
{
Rodeo__begin(state);
Rodeo__draw_rectangle(state, -1, 0, 1, 1, pink);
Rodeo__draw_rectangle(state, 100, 100, 50, 50, red);
Rodeo__draw_rectangle(state, 100, 160, 50, 50, green);
Rodeo__draw_rectangle(state, 160, 100, 50, 50, blue);
Rodeo__draw_rectangle(state, 160, 160, 50, 50, pink);
Rodeo__draw_debug_text(
1,
1,
" using %s renderer ",
Rodeo__get_renderer_name_as_string()
);
Rodeo__end(state);
}
Rodeo__deinit_window(state);
Rodeo__quit();
return 0;
}
|