32static inline double gm_dt() {
return _gm_dt; }
37static inline double gm_t() {
return _gm_t; }
47 __attribute__((import_module(
"gapi"), import_name(
"set_title")))
58 __attribute__((import_module(
"gapi"), import_name(
"resize")))
68 __attribute__((import_module(
"gapi"), import_name(
"set_background_color")))
78 __attribute__((import_module(
"gapi"), import_name(
"fullscreen")))
89 __attribute__((import_module(
"gapi"), import_name(
"log")))
106 __attribute__((import_module(
"gapi"), import_name(
"init")))
108 gapi_init(
const int32_t width,
const int32_t height,
const char *title);
121 __attribute__((import_module(
"gapi"), import_name(
"yield")))
130 __attribute__((import_module(
"gapi"), import_name(
"quit")))
140 __attribute__((import_module(
"gapi"), import_name(
"runs")))
157 __attribute__((import_module(
"gapi"), import_name(
"draw_line")))
172 __attribute__((import_module(
"gapi"), import_name(
"draw_rect")))
188 __attribute__((import_module(
"gapi"), import_name(
"draw_rounded_rect")))
203 __attribute__((import_module(
"gapi"), import_name(
"draw_circle")))
219 __attribute__((import_module(
"gapi"), import_name(
"draw_ellipse")))
236 __attribute__((import_module(
"gapi"), import_name(
"draw_triangle")))
250 __attribute__((import_module(
"gapi"), import_name(
"draw_triangles")))
267 __attribute__((import_module(
"gapi"), import_name(
"create_image")))
283 __attribute__((import_module(
"gapi"), import_name(
"draw_image")))
302 __attribute__((import_module(
"gapi"), import_name(
"draw_image_part")))
305 uint32_t slice_width, uint32_t slice_height,
double x,
306 double y,
double width,
double height);
322 __attribute__((import_module(
"gapi"), import_name(
"draw_text")))
325 const char *font, uint8_t style,
gmColor col);
336 __attribute__((import_module(
"gapi"), import_name(
"key_down")))
346 __attribute__((import_module(
"gapi"), import_name(
"mouse_down")))
358 __attribute__((import_module(
"gapi"), import_name(
"mouse_get")))
uint32_t gmColor
Type definition for color values, stored as a 32-bit unsigned integer. The color components are packe...
Definition color.h:13
void gapi_set_title(const char *title)
Sets the title of the application window.
int32_t gapi_mouse_down()
Checks if the mouse button is currently pressed.
double _gm_dt
Definition gapi.h:20
int32_t gapi_draw_rect(double x, double y, double w, double h, gmColor col)
Draws a filled rectangle on the screen.
int32_t gapi_draw_triangles(uint32_t n_triangles, double *points, gmColor *colors)
Draws a batch of triangles on the screen.
void gapi_fullscreen(const int32_t fullscreen)
Toggles fullscreen mode for the application window.
int32_t gapi_draw_rounded_rect(double x, double y, double w, double h, double r, gmColor col)
Draws a filled rectangle with rounded corners on the screen.
double _gm_t
Definition gapi.h:26
int32_t gapi_draw_image(uint32_t handle, double x, double y, double width, double height)
Draws an image referenced by its handle on the screen.
int32_t gapi_init(const int32_t width, const int32_t height, const char *title)
Initializes the Graphics API and the application window.
void gapi_resize(const int32_t width, const int32_t height)
Resizes the application window.
int32_t gapi_key_down(char t, char k)
Checks if a specific key is currently pressed.
int32_t gapi_draw_triangle(double x1, double y1, double x2, double y2, double x3, double y3, gmColor col)
Draws a filled triangle on the screen.
void gapi_log(const char *message)
Logs a message to the platform's console.
uint32_t gapi_create_image(const unsigned char *data, uint32_t width, uint32_t height)
Creates a platform-specific image handle from raw pixel data.
void gapi_quit()
Requests the application to quit.
int32_t gapi_yield(double *dt)
Yields control to the platform, processes events, and updates timing.
int32_t gapi_draw_text(double x, double y, double height, const char *txt, const char *font, uint8_t style, gmColor col)
Draws text on the screen.
int32_t gapi_runs()
Checks if the application is still running.
int32_t gapi_draw_circle(double center_x, double center_y, double radius, gmColor col)
Draws a filled circle on the screen.
int32_t gapi_draw_image_part(uint32_t handle, uint32_t slice_x, uint32_t slice_y, uint32_t slice_width, uint32_t slice_height, double x, double y, double width, double height)
Draws a part of an image referenced by its handle on the screen.
int32_t gapi_draw_ellipse(double x, double y, double w, double h, gmColor col)
Draws a filled ellipse on the screen.
int32_t gapi_draw_line(double x1, double y1, double x2, double y2, double thickness, gmColor col)
Draws a line segment on the screen.
int32_t gapi_mouse_get(double *x, double *y)
Retrieves the current mouse cursor position.
void gapi_set_background_color(const gmColor background)
Sets the background color of the application window.