honestly this still sucks

This commit is contained in:
KikooDX 2021-11-17 14:46:01 +01:00
parent 6511864509
commit edc6fb1c5b
4 changed files with 14 additions and 7 deletions

View File

@ -11,6 +11,7 @@ Macros:
* `C_WHITE`
* `DWIDTH`
* `DHEIGHT`
* `C_RGB(r, g, b)`
Functions:
* `void rDisplayInit(void);`

View File

@ -15,15 +15,20 @@
/* display size */
#define DWIDTH 396
#define DHEIGHT 224
/* Simple functions. */
/* macros */
#define C_RGB(r, g, b) (Color){r*255/31, g*255/31, b*255/31, 255}
/* simple functions */
#define dclear(c) ClearBackground(c)
#define drect(x1, y1, x2, y2, c) \
DrawRectangle(x1, y1, (x2) - (x1), (y2) - (y1), c)
/* dummy types */
typedef int bopti_image_t;
typedef int font_t;
#endif /* RAYLIB */
/* prototypes */
void rInitDisplay(void);
void rDeinitDisplay(void);
void rDisplayInit(void);
void rDisplayDeinit(void);
void rDrawBegin(void);
void rDrawEnd(void);
void dupdate(void);

View File

@ -5,6 +5,7 @@
#endif /* GINT */
#ifdef RAYLIB
#include <raylib.h>
#define keydown(x) IsKeyDown(x)
#define dclear(x) ClearBackground(x)
void clearevents(void);

View File

@ -1,14 +1,14 @@
#include "raygint/display.h"
#ifdef RAYLIB
void rInitDisplay(void) { InitWindow(DWIDTH, DHEIGHT, "raygint"); }
void rDeinitDisplay(void) { CloseWindow(); }
void rDisplayInit(void) { InitWindow(DWIDTH, DHEIGHT, "raygint"); }
void rDisplayDeinit(void) { CloseWindow(); }
void rDrawBegin(void) { BeginDrawing(); }
void rDrawEnd(void) { EndDrawing(); }
void dupdate(void) {}
#else
void rInitDisplay(void) {}
void rDeinitDisplay(void) {}
void rDisplayInit(void) {}
void rDisplayDeinit(void) {}
void rDrawBegin(void) {}
void rDrawEnd(void) {}
#endif