demo.c
1#include "alba.h"
2
3int main()
4{
5 AlbaWindowOptions options = {0};
6 options.clear_color.r = 0.02;
7 options.clear_color.g = 0.02;
8 options.clear_color.b = 0.02;
9 AlbaWindow* window = create_window(&options);
10
11 float w, h;
12 window_get_size(window, &w, &h);
13 printf("%f %f\n", w, h);
14
15 const float vertices[] = {
16 100, 100,
17 100, 400,
18 200, 100,
19 //
20 300, 150,
21 150, 300
22 };
23 const float color[] = {
24 1.0, 0.0, 0.0, 1.0,
25 0.0, 1.0, 0.0, 1.0,
26 0.0, 0.0, 1.0, 1.0,
27 1.0, 1.0, 1.0, 0.5,
28 1.0, 1.0, 1.0, 0.2,
29 };
30 const uint32_t indices[] = {0, 1, 2, 0, 3, 4};
31 draw_triangles_indexed(window, 5, vertices, color, 6, indices);
32
33 while (!window_should_close(window))
34 {
35 window_render(window);
36 }
37
38 window_release(window);
39}