Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Building Core Engine

Mathew edited this page Sep 9, 2021 · 6 revisions

Cloning the repository

First you need to clone Core Engine with

git clone --recursive https://github.com/lectroMathew/Core.git

You can also download zip archive using your browser on the main repo page.

Move the cloned/unziped folder to your project libraries folder. For this example we'll use lib/Core

Prerequisites

Before proceeding, make sure you have this installed on your system: On Unix* systems, make sure you have sdl2 library installed:

sudo pacman -S sdl2             # on ArchLinux
sudo apt install libsdl2-dev    # on Ubuntu / Debian
brew install sdl2               # on macOS (via Homebrew)

On Windows you'll automatically get a copy of SDL2 under lib/SDL-2.0.10 folder, so you don't have to worry about anything

Building with CMake

CMake is a powerful tool to build differnt kinds of software, Core Engine is not an exception. In the main repo you'll find CMakeLists.txt, that's where the magic happens. Feel free to have a look at the build options available there.

To add Core Engine to your project you have to create your own CMakeLists.txt in your project's directory and add lib/Core as subdirectory there. This will let CMake know there's another CMakeLists.txt waiting for it in the lib/Core folder.

Here's the minimal example of your CMakeLists.txt:

cmake_minimum_required(VERSION 3.16)
project(MyProject VERSION 0.0.1 DESCRIPTION "My Awesome Core Engine project")

# Specify output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out)

# Create a target if you don't have one already. 
add_executable(main src/main.cpp)

add_subdirectory(lib/Core)
target_link_libraries(main PUBLIC core)

Build your application

cmake --build . --target MyApplication

Note: on Unix* systems use gcc or g++ to compile, on Windows MinGW is recommended, MSVC compilation is somtimes possible, but not guaranteed

Now Core Engine will be built and added to your project as library dependency.


Continue reading: Quick Start guide

Table of contents


Architecture


Core Modules

  • Application module
  • Engine module
  • Input module
  • Scene module
  • Network module
  • Math module

Core Components

  • Transform
  • Renderer
  • Camera

Clone this wiki locally