33 lines
859 B
C
33 lines
859 B
C
#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();
|