Table of Contents
C3DGE is an experimental implementation of a 3D Game Engine in C++.
I stopped developing this C++ engine and migrated the code into a Kotlin based solution.
This section should list any major libraries used in this project.
Install GLFW
, GLM
and GLEW
on the target system.
- Arch Linux
# pacman -S glfw glm glew
Compiling C3DGE requires gcc
and cmake
.
- Install the basic tools
- Arch Linux
# pacman -S gcc cmake
-
Clone the repo
$ git clone https://github.com/nflsilva/C3DGE.git
-
Navigate into 3DGE directory and build the library
$ cd 3DGE $ mkdir build $ cd build $ cmake .. $ make
It is possible to implement custom made game objects by sub-classing the Base engine objects.
To use this engine you need to create a game engine delegate. Create your game logic class and implement the delegate methods
class Game : public CoreEngineDelegate {
private:
CoreEngine* engine;
BaseCamera* camera;
Tree* tree;
public:
Game(CoreEngine* engine) : engine(engine) {}
~Game(){};
void OnStart(){
// Called when the engine starts.
// Create your game objects here.
camera = new MovingCamera(
glm::vec3(0, 0, 2),
glm::vec3(0, 0,-1),
glm::vec3(0, 1, 0));
engine->SetCamera(camera);
tree = new Tree(
glm::vec3(0, 0, 0),
glm::vec3(0, 0, 0),
glm::vec3(1, 1, 1));
engine->AddGameObject(tree);
}
void OnUpdate(float elapsedTime, InputState input){
// Called once every game tick.
// Useful for input processing.
}
void OnRender(){
// Called once every game frame.
}
void OnDestroy(){
// Called when the game stops.
// Free any objects you needed.
}
};
For more examples, please refer to the TesterGame Project
Distributed under the MIT License. See LICENSE.txt
for more information.
As guide and study material I would like to acknowledge the following: