GoldFish Engine
Quite simple and lightweight game engine
Loading...
Searching...
No Matches
gf_core.h File Reference

Core. More...

#include <gf_pre.h>
#include <gf_macro.h>
#include <gf_type/core.h>
#include <gf_type/draw.h>

Go to the source code of this file.

Functions

void gf_engine_begin (void)
 Initialize engine.
 
void gf_engine_end (void)
 Cleanup engine.
 
gf_engine_tgf_engine_create (const char *title, int nogui)
 Create engine instance.
 
void gf_engine_loop (gf_engine_t *engine)
 Start engine main loop.
 
void gf_engine_destroy (gf_engine_t *engine)
 Destroy engine instance.
 

Detailed Description

Core.

Definition in file gf_core.h.

Function Documentation

◆ gf_engine_begin()

void gf_engine_begin ( void  )
extern

Initialize engine.

Definition at line 24 of file gf_core.c.

◆ gf_engine_create()

gf_engine_t * gf_engine_create ( const char *  title,
int  nogui 
)
extern

Create engine instance.

Parameters
titleTitle to be shown on the window
nogui0 to enable client-part, otherwise disable client-part
Returns
Engine instance

Definition at line 51 of file gf_core.c.

◆ gf_engine_destroy()

void gf_engine_destroy ( gf_engine_t engine)
extern

Destroy engine instance.

Parameters
engineEngine instance

Definition at line 94 of file gf_core.c.

◆ gf_engine_end()

void gf_engine_end ( void  )
extern

Cleanup engine.

Definition at line 46 of file gf_core.c.

◆ gf_engine_loop()

void gf_engine_loop ( gf_engine_t engine)
extern

Start engine main loop.

Parameters
engineEngine instance
Note
How engine draws a frame internally is explained in gf_core.c

Writing this so I don't forget

  1. Calls gf_client_step
  2. gf_client_step calls gf_draw_step
  3. gf_draw_step calls gf_draw_platform_step (Platform-dependent)
  4. gf_draw_platform_step processes platform-dependent stuffs (e.g. events)
  5. gf_draw_platform_step calls gf_draw_driver_before
  6. gf_draw_platform_step calls gf_draw_frame
  7. gf_draw_frame draws stuffs
  8. gf_draw_platform_step calls gf_draw_driver_after
  9. gf_draw_platform_step swaps buffers
  10. Comes back here

Definition at line 86 of file gf_core.c.