Code Monkey home page Code Monkey logo

lcge's Introduction

LCGE

     ___       ________  ________  _______
    |\  \     |\   ____\|\   ____\|\  ___ \
    \ \  \    \ \  \___|\ \  \___|\ \   __/|
     \ \  \    \ \  \    \ \  \  __\ \  \_|/__
      \ \  \____\ \  \____\ \  \|\  \ \  \_|\ \
       \ \_______\ \_______\ \_______\ \_______\
        \|_______|\|_______|\|_______|\|_______| v1.1.0

A Lightweight C game engine built with OpenGL.

Docs

TOC

Capabilities

  • Create a window
  • Maintain an FPS
  • Render 2D rectangles
  • Render 2D images
  • Render 2D lines
  • Rotate 2D rectangles and images
  • Get keyboard input
  • Get mouse input
  • Load truetype fonts
  • Render text
  • More coming soon!

Build From Source

  1. Clone
git clone --recursive https://github.com/SatvikR/LCGE.git
  1. Build using CMake
cmake -B ./build .
cmake --build ./build

Make sure you link with LCGE (shared), glad, and glfw

Basic usage

Look here for specific exaxmples

#include <LCGE/lcge.h>

int main(int argc, char const *argv[])
{
    // Initialize LCGE with the path to the res directory of LCGE (specific to you)
    if (lcge_init("vendor/LCGE/res") == LCGE_INIT_ERR)
    {
        lcge_exit();
        return -1;
    }

    // Create a window
    int success = lcge_create_context(500, 500, "LCGE Example",
                                      LCGE_NON_RESIZEABLE);

    // Create clock with a max fps
    LCGE_clock *clock = lcge_clock_create(60);

    // Check if there was an error creating the window
    if (success == LCGE_CONTEXT_ERR)
    {
        lcge_exit();
        return -1;
    }

    while (lcge_window_is_open())
    {
        // Do any udpating here

        // Do any drawing here
        lcge_window_clear();

        // Get ready for next iteration
        lcge_clock_tick(clock);
        lcge_window_update();
    }

    // Clean up
    lcge_clock_delete(clock);

    lcge_exit();

    return 0;
}

License(s)

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

Copyright (c) 2021 Satvik Reddy

A brief summary of the license:

  • You can use LCGE in any project, though if its closed source, you must dynamically link with LCGE
  • If you make changes/additions to LCGE, they must be released with an LGPL compatible license (though I prefer you submit your changes back to this repository)
  • More info in the LICENSE file in the root of the source tree

Dependencies

Dependency License
GLFW zlib/libpng
glad Public Domain/WTFPL/CC0
stb MIT/Public Domain

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.