Skip to content

Commit

Permalink
refactor(core): renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
ms0g committed Apr 8, 2024
1 parent 68b0f47 commit ccb96dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.23.0)
project(voxen VERSION 0.1.0)
project(cae VERSION 0.1.0)

set(CMAKE_CXX_STANDARD 20)

Expand Down
14 changes: 7 additions & 7 deletions src/core/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "../world/world.h"
#include "../world/skybox.h"

CellularAutomatonEngine::CellularAutomatonEngine() = default;
CellularAutomatonEngine::~CellularAutomatonEngine() = default;
CAEngine::CAEngine() = default;
CAEngine::~CAEngine() = default;

void CellularAutomatonEngine::init() {
void CAEngine::init() {
mWindow = std::make_unique<Window>();
mWindow->init("Voxel Engine");

Expand Down Expand Up @@ -44,19 +44,19 @@ void CellularAutomatonEngine::init() {
mIsRunning = true;
}

void CellularAutomatonEngine::run(World& world, Skybox& skybox) {
void CAEngine::run(World& world, Skybox& skybox) {
while (mIsRunning) {
processInput();
update(world);
render(world, skybox);
}
}

void CellularAutomatonEngine::processInput() {
void CAEngine::processInput() {
mInput->process(*mCamera, mWindow->nativeHandle(), mDeltaTime, mIsRunning);
}

void CellularAutomatonEngine::update(World& world) {
void CAEngine::update(World& world) {
mDeltaTime = (SDL_GetTicks() - mMillisecsPreviousFrame) / 1000.0f;
mMillisecsPreviousFrame = SDL_GetTicks();
#ifdef DEBUG
Expand All @@ -68,7 +68,7 @@ void CellularAutomatonEngine::update(World& world) {
mCamera->update();
}

void CellularAutomatonEngine::render(World& world, Skybox& skybox) {
void CAEngine::render(World& world, Skybox& skybox) {
mWindow->clear(0.2f, 0.3f, 0.3f, 1.0f);

glm::mat4 view = mCamera->getViewMatrix();
Expand Down
6 changes: 3 additions & 3 deletions src/core/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class Camera;
class Window;
class Input;
class Gui;
class CellularAutomatonEngine {
class CAEngine {
public:
CellularAutomatonEngine();
CAEngine();

~CellularAutomatonEngine();
~CAEngine();

void init();

Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#include "world/skybox.h"

int main() {
CellularAutomatonEngine cae;
CAEngine cae;
cae.init();

World world;
Skybox skyBox;
World world{};
Skybox skyBox{};

cae.run(world, skyBox);

Expand Down

0 comments on commit ccb96dd

Please sign in to comment.