Base.
This commit is contained in:
commit
ff3b538ecb
|
@ -0,0 +1,20 @@
|
|||
# raygint
|
||||
Bindings to make "cross platform games", gint on calculator and raylib on
|
||||
desktop. Work in progress. Following are the supported define and functions.
|
||||
|
||||
## `raygint/display.h`
|
||||
Macros:
|
||||
* `C_WHITE`
|
||||
* `DWIDTH`
|
||||
* `DHEIGHT`
|
||||
|
||||
Functions:
|
||||
* `void rDisplayInit(void);`
|
||||
* `void rDisplayDeinit(void);`
|
||||
* `void dupdate(void);`
|
||||
|
||||
## `raygint/keyboard.h`
|
||||
Functions:
|
||||
* `void clearevents(void);`
|
||||
* `void dclear(color_t color);`
|
||||
* `int keydown(int key);`
|
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef GINT
|
||||
#include <gint/display.h>
|
||||
#endif /* GINT */
|
||||
|
||||
#ifdef RAYLIB
|
||||
#include <raylib.h>
|
||||
/* Colors. */
|
||||
#define C_WHITE WHITE
|
||||
/* Simple functions. */
|
||||
#define drect(x, y, w, h, c) DrawRectangle(x, y, (x) - (w), (y) - (h), c)
|
||||
#endif /* RAYLIB */
|
||||
|
||||
#ifdef RAYLIB_CG
|
||||
/* Display size. */
|
||||
#define DWIDTH 396
|
||||
#define DHEIGHT 224
|
||||
#endif
|
||||
|
||||
/* Function prototypes. */
|
||||
void rInitDisplay(void);
|
||||
void rDeinitDisplay(void);
|
||||
void dupdate(void);
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef GINT
|
||||
#include <gint/keyboard.h>
|
||||
#endif /* GINT */
|
||||
|
||||
#ifdef RAYLIB
|
||||
/* Simple functions. */
|
||||
#define keydown(x) IsKeyDown(x)
|
||||
#define dclear(x) ClearBackground(x)
|
||||
/* Useless functions, do nothing. */
|
||||
void clearevents(void) {};
|
||||
#endif /* RAYLIB */
|
|
@ -0,0 +1,16 @@
|
|||
#include "raygint/display.h"
|
||||
|
||||
#ifdef RAYLIB
|
||||
void rInitDisplay(void) {
|
||||
InitWindow(DWIDTH, DHEIGHT, "raygint");
|
||||
}
|
||||
|
||||
void rDeinitDisplay(void) {
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
void dupdate(void) {}
|
||||
#else
|
||||
void rInitDisplay(void) {};
|
||||
void rDeinitDisplay(void) {};
|
||||
#endif
|
Loading…
Reference in New Issue