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
|
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <raylib.h>
#include <lcq/qoi.h>
#include <lcq/gastro.h>
#include <lcq/gastro/test.h>
/* #include "../converted_model.h" */
int main(int argc, char **argv) {
gastro_ctx ctx;
u32 width = 256, height = 256;
gastro_color *pixels = calloc(width * height, sizeof(gastro_color));
gastro_fix *depth = calloc(width * height, sizeof(gastro_fix));
gastro_ctx_init(&ctx, width, height, pixels, depth);
gastro_test_create();
InitWindow(800, 600, "test");
{
Image im;
Texture2D tex;
im.data = ctx.pixels;
im.width = (int) ctx.width;
im.height = (int) ctx.height;
im.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
im.mipmaps = 1;
tex = LoadTextureFromImage(im);
SetTargetFPS(300);
while (!WindowShouldClose()) {
Vector2 pos;
pos.x = 10; pos.y = 10;
gastro_test_render(&ctx);
BeginDrawing();
ClearBackground(RED);
UpdateTexture(tex, ctx.pixels);
DrawTextureEx(tex, pos, 0.0, 4.0, WHITE);
DrawFPS(10, 10);
EndDrawing();
}
}
CloseWindow();
(void) argc; (void) argv;
return 0;
}
|