test render loop

This commit is contained in:
2025-03-09 18:35:56 +05:00
parent 0291279f1a
commit 4de066b6c1
7 changed files with 205 additions and 12 deletions

32
src/VM/Display/Display.h Normal file
View File

@@ -0,0 +1,32 @@
#pragma once
#include "../../std.h"
#include "../../string/str.h"
typedef struct Rect {
i32 x, y;
i32 w, h;
} Rect;
#define Rect_create(X, Y, W, H) ((Rect){ .x = X, .y = Y, .w = W, .h = H})
typedef struct ColorRGBA {
u8 r, g, b, a;
} ColorRGBA;
#define ColorRGBA_create(R, G, B, A) ((ColorRGBA){ .r = R, .g = G, .b = B, .a = A })
typedef enum DisplayFlags {
DisplayFlags_Default = 0
} DisplayFlags;
typedef struct Display Display;
Display* Display_create(str name, i32 w, i32 h, DisplayFlags flags);
void Display_destroy(Display* d);
bool Display_setName(Display* d, str name);
bool Display_setSize(Display* d, u32 w, u32 h);
bool Display_setDrawingColor(Display* d, ColorRGBA color);
bool Display_clear(Display* d);
bool Display_fillRect(Display* d, Rect rect);
bool Display_swapBuffers(Display* d);
NULLABLE(cstr) Display_getError();