-
Notifications
You must be signed in to change notification settings - Fork 15
Ethertia Dev Doc
Eldrine Le Prismarine edited this page Mar 2, 2023
·
10 revisions
Welcome to Ethertia Development Documentation.
- Project Files Structure
- Program Structure
- Rendering (OpenGL)
- Audio (OpenAL)
- Entity System
- Voxel Terrain System
- Item System
- GUI
lib/
libraries.run/
runtime working directory > -assets/
default assets
bin/
binaries. shared-library, executable. > -darwin-x64/
windows-x64/
windows-arm64/
logs/
mods/
saves/
worlds / savesscreenshots/
settings.json
(client) settingsserver.json
dedicated server settingssrc/
c++ sources & headers.CMakeLists.txt
README.md
> ...
Basically there are 3 directories here: lib/
, run/
and src/
, which are external libraries, runtime working directory, and source code.
The entrance is in the ethertia/Ethertia.cpp
's main(), as you can see, the top (highest) level flow is:
void Ethertia::run()
{
start();
while (m_Running)
{
runMainLoop();
}
destroy();
}
The start()
initializes the system, runMainLoop()
keep updating every frame (rendering, physics, world), at the end destroy()
is called for system clean up (when system shotdown).
-
Let's quick look the
start()
void Ethertia::start() { Settings::loadSettings(); // just load settings ModLoader::loadMods(); // load & pre-init mods. // System Initialize m_Window = new Window(...); // main display/window m_GuiRoot = new GuiRoot(); // root GUI RenderEngine::init(); AudioEngine::init(); // Material & Items init. (texture, mesh) ... // Network System, Controls init. ... // Other Threads (ChunkGen, ChunkMeshGen) ... }
-
It's time to dive into the
runMainLoop()
there is the Core of the System.Ethertia::runMainLoop() { m_Timer.update(); m_Scheduler.processTasks(); while (m_Timer.polltick()) { runTick(); } Controls::handleInput(); // glfwPollEvents(); RenderEngine::renderWorld(m_World); renderGUI(); m_Window->SwapBuffer(); }
-
A glimpse at
destroy()