Gama C Library
Gama C API Documentation
gama.h File Reference

Core header file for the Gama engine. More...

#include "draw.h"
#include "gapi.h"
#include "stdio.h"
#include "widgets/frame.h"
#include <unistd.h>

Go to the source code of this file.

Functions

int main ()
int32_t gama_run ()
void gm_fullscreen (int fullscreen)
 Puts the window in fullscreen.
void gm_logo (double x, double y, double s)
 Draws the Gama logo.
void gm_log (const char *txt)
 Logs a message to the platform's console.
void gm_show_fps (int show)
void gm_background (gmColor c)
 Sets the background color of the window.
void gm_resize (int width, int height)
 Resizes the application window.
void gm_init (int width, int height, const char *title)
 Initializes the Gama engine and opens a window.
void gm_sleep (int milliseconds)
 Pauses execution for a specified duration.

Variables

int __gm_show_fps = 0
 Enables or disables the built-in FPS counter display.

Detailed Description

Core header file for the Gama engine.

This file includes all the necessary headers and provides the main functions for initializing the engine, managing the game loop, and handling basic window operations.

Function Documentation

◆ gama_run()

int32_t gama_run ( )

◆ gm_background()

void gm_background ( gmColor c)

Sets the background color of the window.

Parameters
cThe color to set as the background.
Examples
/home/engon/gama/gama/lib/gama/gama.h.

◆ gm_fullscreen()

void gm_fullscreen ( int fullscreen)

Puts the window in fullscreen.

Parameters
fullscreenBoolean flag to enable (1) or disable (0) fullscreen.
Examples
/home/engon/gama/gama/lib/gama/gama.h.

◆ gm_init()

void gm_init ( int width,
int height,
const char * title )

Initializes the Gama engine and opens a window.

This must be the first Gama function called. It sets up the graphics context and creates a window with the specified dimensions and title.

Parameters
widthThe width of the window in pixels. Use 0 for automatic sizing.
heightThe height of the window in pixels. Use 0 for automatic sizing.
titleThe title of the window.
Examples
/home/engon/gama/gama/lib/gama/gama.h.

◆ gm_log()

void gm_log ( const char * txt)

Logs a message to the platform's console.

Parameters
txtThe text message to log.
Examples
/home/engon/gama/gama/lib/gama/gama.h.

◆ gm_logo()

void gm_logo ( double x,
double y,
double s )

Draws the Gama logo.

Parameters
xThe center x position to draw the logo.
yThe center y position to draw the logo.
sThe size (side length) of the logo.
Examples
/home/engon/gama/gama/lib/gama/gama.h.

◆ gm_resize()

void gm_resize ( int width,
int height )

Resizes the application window.

Parameters
widthThe new width of the window in pixels.
heightThe new height of the window in pixels.
Examples
/home/engon/gama/gama/lib/gama/gama.h.

◆ gm_show_fps()

void gm_show_fps ( int show)

◆ gm_sleep()

void gm_sleep ( int milliseconds)

Pauses execution for a specified duration.

This function blocks the calling thread for approximately the given number of milliseconds.

Parameters
millisecondsThe number of milliseconds to sleep.
Examples
/home/engon/gama/gama/lib/gama/gama.h.

◆ main()

Variable Documentation

◆ __gm_show_fps

int __gm_show_fps = 0

Enables or disables the built-in FPS counter display.

Parameters
showBoolean flag to show (1) or hide (0) the FPS counter.
Examples
/home/engon/gama/gama/lib/gama/gama.h.