Skip to content

Commit

Permalink
fix: tuck away the project definition to the AppSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed Sep 18, 2024
1 parent aa87150 commit a5d835b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 7 additions & 1 deletion editor/Editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
#define XSTR(s) STR(s)
#define STR(s) #s

#define NAME "Volt v" XSTR(VOLT_VERSION)

struct Editor : public volt::app::IAppBackend {
volt::app::AppSpec Init(void) final {
return {
.renderer {
.width = 1280,
.height = 720,
.name = "Volt v" XSTR(VOLT_VERSION),
.name = NAME,
.max_fps = 75,
.is_editor = true
},
.project {
.name = NAME,
.path = "."
}
};
}
Expand Down
1 change: 1 addition & 0 deletions src/App/AppSpec.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
namespace volt::app {
struct AppSpec {
renderer::RenderSystemSpec renderer;
runtime::ProjectSpec project;
};
}
6 changes: 2 additions & 4 deletions src/App/Entrypoint.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ int main(void) {
volt::runtime::PhysicsSystem physics;
volt::runtime::InputSystem input;

volt::runtime::Project proj {{
.name = app_spec.renderer.name,
.path = "."
}};
volt::runtime::Project proj { app_spec.project };

auto &scene { *proj.CreateScene("Main") };
app->Start(scene);
if (not renderer.IsEditor()) scene.Play();
Expand Down

0 comments on commit a5d835b

Please sign in to comment.