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

Quick Start guide

Mathew edited this page Sep 9, 2021 · 9 revisions

Preamble

To use Core Engine first you have to decide on set of modules you wish to build your Core with.
This could be any of the standard modules shipped with the engine itself (see: list of standard Core modules), or any of user-defined ones.

In case you haven't built the library yet, see Building page of wiki first.


The guide

You can start using Core Engine with just 4 simple steps:

1. Start with creating core::CoreConfig object like so:

#include <core/CoreConfig.h>

// ...

core::CoreConfig config;

2. Add all your modules to the config

Provide module factory function to core::CoreConfig::Add(), or use generic NewModule<T> (defined in core/ModuleContainer.h) function which will simply pass all arguments to the module constructor.

Usually you'll be passing already added to the config modules as dependencies to other modules (like InputModule with EngineModule below), in case they rely on them. (Why? see: IoC principle)

#include <core/Modules/ApplicationModule.h>
#include <core/Modules/EngineModule.h>
#include <core/Modules/SceneModule.h>

// ...

config
    .Add(NewModule<InputModule>)
    .Add(NewModule<EngineModule, InputModule>)
    .Add(NewModule<SceneModule>)
    .Add(NewModule<ApplicationModule>);

3. Build the engine by calling core::CoreConfig::Build()

Yep, as simple as that. CoreConfig will kindly add all of your modules into your shiny Core object and return it wrapped into CoreContainer. Also it will throw a bunch of fatals in case you forgot to resolve any of the dependencies.

CoreContainer coreContainer = config.Build();

4. Congratulations, you are amazing!

At this point you have a working Core object and all that's left for you is to comprehend the boundaries of the universe with it!


Continue reading: Core Engine Architecture

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