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 const float vertices[] = {
12 -0.5, -0.5,
13 +0.5, -0.5,
14 +0.5, +0.5,
15 //
16 0.8, 0.0,
17 -0.5, 0.75
18 };
19 const float color[] = {
20 1.0, 0.0, 0.0, 1.0,
21 0.0, 1.0, 0.0, 1.0,
22 0.0, 0.0, 1.0, 1.0,
23 1.0, 1.0, 1.0, 0.5,
24 1.0, 1.0, 1.0, 0.2,
25 };
26 const uint32_t indices[] = {0, 1, 2, 0, 3, 4};
27 draw_triangles(window, 5, 6, vertices, color, indices);
28
29 while (!window_should_close(window))
30 {
31 window_render(window);
32 }
33
34 window_release(window);
35}