12#define GAMA_VERSION_MAJOR 0
13#define GAMA_VERSION_MINOR 1
14#define GAMA_VERSION_PATCH 0
41void gm_logo(
double x,
double y,
double s) {
42 double top_thickness = 0.15 * s;
43 double left_thickness = 0.1 * s;
60static inline int gm_runs() {
return gapi_runs(); }
66 static const double alpha = 0.9;
67 static double _fps = 0;
69 static double _display_fps = 0;
71 double fps = 1 / gm_dt();
75 _fps = (_fps * alpha) + (fps * (1 - alpha));
83 snprintf(fps_text,
sizeof(fps_text),
"fps: %.2lf", _display_fps);
104static inline int gm_yield() {
120static inline void gm_quit() {
return gapi_quit(); }
150void gm_init(
int width,
int height,
const char *title) {
151 int code =
gapi_init(width, height, title);
155 snprintf(msg,
sizeof(msg),
156 "Error starting gama, initialization exited with non zero code %d",
175void gm_sleep(
int milliseconds) { Sleep(milliseconds); }
178void gm_sleep(
int milliseconds) { usleep(milliseconds * 1000); }
Functions for animating values with various easing functions.
#define gm_blue(col)
Extracts the blue component from a color.
Definition color.h:29
#define gm_green(col)
Extracts the green component from a color.
Definition color.h:22
unsigned int gmColor
Type definition for color values in RGBA format.
Definition color.h:8
#define gm_red(col)
Extracts the red component from a color.
Definition color.h:15
#define GM_GAMA
The official Gama brand color.
Definition color.h:126
#define GM_BLACK
Black color.
Definition color.h:166
#define gm_alpha(col)
Extracts the alpha component from a color.
Definition color.h:36
#define GM_WHITE
White color.
Definition color.h:851
Functions for drawing shapes, text, and images.
int32_t gm_draw_text(double x, double y, const char *text, const char *font, double font_size, gmColor c)
Draws text.
Definition draw.h:135
int32_t gm_draw_rectangle(double x, double y, double w, double h, gmColor c)
Draws a rectangle.
Definition draw.h:47
int gmw_frame(double x, double y, double width, double height)
Creates and renders a frame widget (a bordered panel).
Definition frame.h:67
void gm_log(const char *txt)
Definition gama.h:52
void gm_show_fps(int show)
Definition gama.h:63
int __gm_show_fps
Definition gama.h:62
void _gm_fps()
Definition gama.h:65
void gm_resize(int width, int height)
Definition gama.h:138
void gm_logo(double x, double y, double s)
Draws gama logo.
Definition gama.h:41
void gm_sleep(int milliseconds)
Sleep(wait) for aproximately the specified number of milliseconds.
Definition gama.h:178
void gm_fullscreen(int fullscreen)
Puts the window in fullscreen.
Definition gama.h:32
void gm_background(gmColor c)
Sets the background color of the window.
Definition gama.h:134
void gm_sync()
Waits for all pending graphics operations to complete.
Definition gama.h:128
void gm_init(int width, int height, const char *title)
Initializes the Gama engine and opens a window.
Definition gama.h:150
int32_t gapi_mouse_down()
double _gm_dt
Definition gapi.h:6
void gapi_fullscreen(const int32_t fullscreen)
int32_t gapi_mouse_pressed()
void gapi_set_bg_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a)
double _gm_t
Definition gapi.h:7
int32_t gapi_init(const int32_t width, const int32_t height, const char *title)
void gapi_resize(const int32_t width, const int32_t height)
void gapi_log(const char *message)
void gapi_get_mouse_move(double *x, double *y)
int32_t gapi_yield(double *dt)
struct _gmMouse gm_mouse
Definition gapi.h:19
int32_t gapi_mouse_get(double *x, double *y)