Gama C Library
Gama C API Documentation
Loading...
Searching...
No Matches
gama.h File Reference

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

#include "animate.h"
#include "body.h"
#include "draw.h"
#include "gapi.h"
#include "key.h"
#include "physics.h"
#include "sprite.h"
#include "system.h"
#include "widgets.h"
#include <stdio.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define GAMA_VERSION_MAJOR   0
#define GAMA_VERSION_MINOR   1
#define GAMA_VERSION_PATCH   0

Functions

void gm_fullscreen (int fullscreen)
 Puts the window in fullscreen.
void gm_logo (double x, double y, double s)
 Draws gama logo.
void gm_log (const char *txt)
void gm_show_fps (int show)
void _gm_fps ()
void gm_sync ()
 Waits for all pending graphics operations to complete.
void gm_background (gmColor c)
 Sets the background color of the window.
void gm_resize (int width, int height)
void gm_init (int width, int height, const char *title)
 Initializes the Gama engine and opens a window.
void gm_sleep (int milliseconds)
 Sleep(wait) for aproximately the specified number of milliseconds.

Variables

int __gm_show_fps = 0

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.

Macro Definition Documentation

◆ GAMA_VERSION_MAJOR

#define GAMA_VERSION_MAJOR   0

◆ GAMA_VERSION_MINOR

#define GAMA_VERSION_MINOR   1

◆ GAMA_VERSION_PATCH

#define GAMA_VERSION_PATCH   0

Function Documentation

◆ _gm_fps()

void _gm_fps ( )

◆ 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.h.

◆ gm_fullscreen()

void gm_fullscreen ( int fullscreen)

Puts the window in fullscreen.

Parameters
fullscreenEnable or disable fullscreen.
Examples
/home/engon/gama/gama/lib/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.
heightThe height of the window in pixels.
titleThe title of the window.
Examples
/home/engon/gama/gama/lib/gama.h.

◆ gm_log()

void gm_log ( const char * txt)

◆ gm_logo()

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

Draws gama logo.

Parameters
xThe x position to draw the logo.
yThe y position to draw the logo.
sThe logo size.
Examples
/home/engon/gama/gama/lib/gama.h.

◆ gm_resize()

void gm_resize ( int width,
int height )

◆ gm_show_fps()

void gm_show_fps ( int show)

◆ gm_sleep()

void gm_sleep ( int milliseconds)

Sleep(wait) for aproximately the specified number of milliseconds.

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

◆ gm_sync()

void gm_sync ( )

Waits for all pending graphics operations to complete.

This can be used for synchronization purposes, but it is rarely needed as gm_yield() handles buffer swapping automatically.

Examples
/home/engon/gama/gama/lib/gama.h.

Variable Documentation

◆ __gm_show_fps

int __gm_show_fps = 0