Works

C++ and DirectX 9

Rain Forest Engine (C++/Directx/physx)

Volleyball Court is a physics playground test proof of my own game engine subsystems implementations.

game engine implementations

dll engine codebase sdk

engine Subsystem factory pattern

rendering in directx 9

physics with nvidia middleware integration

camera translation and orientation

gouraud shading
‍‍
UI with dear imgui 1.6

Architecture

My first idea was to implement the game engine core as a general subsystem so that the games that were built on top of it could use those susbsystems as general interfaces. So the core system was built as a DLL and the client (game) used that to assemble the game logic with needed components.

The first version of the engine will have the following susbsystems:

IDE Folder and Files Organization

The project structure is following other game engine projects organization where the core engine code base is separated as DLL project and the client game code is referencing the game engine source code as dependency and have their game logic calling all needed game engine systems to implement the game features.

The game client then is responsible first to setup the game, which rendering and physics api to use, specify the game data, start and shutdown the application.

The following snippet code is common to all games using the engine:

Engine Entry Point

// Setup Game Engine Configuration
rfConfig engineConfig;
// Setup the target OS to run the game
engineConfig.platform = EngineConfig::Platform::Windows;
// Setup the graphics API that the game uses for rendering
engineConfig.graphicsAPI = EngineConfig::GraphicsAPI::DirectX9;
// Set which physics API version to use
engineConfig.physicsAPI = EngineConfig::PhysicsAPI::PhysX_ver2_81;
// Feed the application with engine configuration
rfApplication::Setup(engineConfig);
// Init the application subsystems
// If all susbsystems started properly, then run the application
if (rfApplication::Init()) rfApplication::Run();
// Engine cleanup resources
rfApplication::ShutDown();
view raw main.cpp hosted with ❤ by GitHub

When doing the setup on the engine, rfConfig class stores this data coming from client (game) and visible to all susbsystems when they need access to.

Engine Configuration

void rfApplication::Setup(const rfConfig& config)
{
RFGE_LOG("\n Rain Forest Game Engine");
RFGE_LOG("------------------------------\n");
rfConfig::Instance = config;
RFGE_LOG("Setup Configuration.\n");
}
view raw Setup.cpp hosted with ❤ by GitHub

Regardless which API is being used for the subsystems they are abstraction functionality to process game engine data.

The renderer will be initiated as well as the physics susbsystem and the window subsystem not entering into implementation details.

Subsystem factory pattern initialization

void rfRenderer::CreateInstance()
{
if (rfConfig::Instance.graphicsAPI == EngineConfig::GraphicsAPI::DirectX9)
Singleton = new Directx9Renderer();
}
bool rfRenderer::Init()
{
return Singleton?Singleton->Initialized():0;
}
view raw rfRenderer.cpp hosted with ❤ by GitHub

Initiating Subsystems

Each subsystem is an interface that derived classes will implement the Initialized function returning whether the subsystem initiated properly or not.

bool rfApplication::Init()
{
RFGE_LOG("\n Initiating sub systems");
RFGE_LOG("------------------------------\n");
InitWindow() ? RFGE_LOG("\n Initiated window system..."): Abort();
InitRenderer()? RFGE_LOG("\n Initiated render system..."): Abort();
InitPhysics() ? RFGE_LOG("\n Initiated physics system..."): Abort();
return !subSystemsInitiated;
}
view raw susbsystems.cpp hosted with ❤ by GitHub

Subsystem interface pattern

For instance, when starting the renderer subsystem the engine first create the renderer instance based on configuration and each initialized function is implemented differently depending on the subsystem features and commands.

//-----------------------------------------------------------------------------
// Init the window system
//-----------------------------------------------------------------------------
bool rfApplication::InitWindow()
{
RFGE_LOG("\n Initiating window system...");
rfWindowSystem::CreateInstance();
return rfWindowSystem::Init();
}
//-----------------------------------------------------------------------------
// Init the render system
//-----------------------------------------------------------------------------
bool rfApplication::InitRenderer()
{
RFGE_LOG("\n Initiating renderer...");
rfRenderer::CreateInstance();
return rfRenderer::Init();
}
//-----------------------------------------------------------------------------
// Instructions to render the scene frame
//-----------------------------------------------------------------------------
bool rfApplication::InitPhysics()
{
RFGE_LOG("\n Initiating physics...");
rfPhysics::CreateInstance();
return rfPhysics::Init();
}
More PROJECTS
Made in Webflow