top of page

Architecture so far...

  • Writer: Pablo Narvaja
    Pablo Narvaja
  • Apr 16, 2020
  • 2 min read

Hi there. In this post I will comment the architecture decisions I've made.

Things that changed:

  • Folder structure

  • System calls to the window

  • Pure Virtual Interfaces

  • GameManager

  • Engine executable - Game Shared Library


Folder Structure

The folder structure have been refactored to have the include folder for the libraries to import

so some header files have been moved to the include folder.

The folder structure now look like this:

  • llamathrust/src: engine source

  • llamathrust/include: engine include files (pure virtual interfaces)

  • external: libraries sources/binaries

  • resources: shaders, fonts and assets

  • bin: compiled solution binaries (created at compile time/ not shipped in src code)

  • demo: demo project using the engine


System calls to the window

The "Window" class have been deleted and was replaced by function pointers to functions implemented in <platform_name>_main.cpp because the OOP aproach gives too much truble and became messy. This aproach does not support multiple windows.


Pure Virtual Interfaces

Some classes were make implementations of pure virtual classes to abstract and hide the code to the end user of the engine. The classes modified are:

  • VideoDriver

  • RenderSystem

  • Shader

  • Input

  • Transform

  • Mesh

  • Material

  • Camera


Game Manager

The game levels are called "Games" and corresponde to the class "Game". This architecture will be explained later but short explanation would be: A game contains multiple layers, every layer contains one scene and they handle the clicks events they are given from top (front of the screen) to bottom (back of the screen), then a scene is 3D or 2D depending whether is a Sprite game or is a 3D game.

The game manager is responsible for loading/updating/unloading a game and maintaining stats between them. There most always be one and only one game running else the engine crashes (at the moment is not handled the event no game is running but will only mean the engine throw an alert and exits).


Engine executable - Game Shared Library

And finally the most important change is that the engine runs like an application that load the game specified in the engine.cfg file which is a shared library this is done to make the change of running different games with only changing a file and not to compile differents projects.



That's all for this post, folks. Bye!

Comments


  • facebook
  • linkedin
  • youtube
  • generic-social-link
  • Grey LinkedIn Icon
  • Facebook
  • YouTube

2019 Pablo Narvaja. Llamathrust GameEngine

bottom of page