LCGE  v0.3.0-alpha
A Lightweight C game engine built with OpenGL
LCGE Docs

What is LCGE?

A Lightweight C game engine built with OpenGL.

Build

git clone --recursive https://github.com/SatvikR/LCGE.git
cmake -B ./build .
cmake --build ./build

Basic Usage

#include <LCGE/lcge.h>
int main(int argc, char const *argv[])
{
// Initialize LCGE with the path to the res directory of LCGE
if (lcge_init("vendor/LCGE/res") == LCGE_INIT_ERR)
{
return -1;
}
// Create a window
int success = lcge_create_context(500, 500, "LCGE Example",
// Create clock with a max fps
// Check if there was an error creating the window
if (success == LCGE_CONTEXT_ERR)
{
return -1;
}
{
// Do any udpating here
// Do any drawing here
// Get ready for next iteration
}
// Clean up
return 0;
}
Header file to include when using the LCGE engine.
LCGE_IMPORT int lcge_init(const char *lcge_res_dir)
Initializes LCGE.
LCGE_IMPORT LCGE_clock * lcge_clock_create(unsigned int fps)
Creates a clock.
LCGE_IMPORT int lcge_window_is_open()
Returns whether or not the window is still open.
LCGE_IMPORT void lcge_clock_tick(LCGE_clock *clock)
tickst the clock.
#define LCGE_INIT_ERR
Definition: lcge.h:49
struct LCGE_clock LCGE_clock
Basic FPS clock.
Definition: lcge.h:321
LCGE_IMPORT int lcge_create_context(unsigned int width, unsigned int height, const char *title, int resizable)
Create a window and get back a handle.
#define LCGE_CONTEXT_ERR
Definition: lcge.h:55
#define LCGE_NON_RESIZEABLE
Definition: lcge.h:53
LCGE_IMPORT void lcge_window_update()
Updates the window and polls for events.
LCGE_IMPORT void lcge_window_clear()
Clears the window.
LCGE_IMPORT void lcge_exit()
Exits lcge.
LCGE_IMPORT void lcge_clock_delete(LCGE_clock *clock)
Deletes a clock.

License

LCGE is licensed under the GNU Lesser General Public License v2.1