Skip to content

Commit

Permalink
docs(engine): pass main args to Cubos in all samples
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Sep 28, 2024
1 parent 467cf03 commit 4a09cb2
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions engine/samples/assets/bridge/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class TextBridge : public FileBridge
};
/// [TextBridge::saveToFile]

int main()
int main(int argc, char** argv)
{
auto cubos = Cubos();
auto cubos = Cubos(argc, argv);

cubos.plugin(settingsPlugin);
cubos.plugin(assetsPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/assets/json/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ CUBOS_REFLECT_IMPL(Strings)
}
/// [Asset type]

int main()
int main(int argc, char** argv)
{
Cubos cubos{};
Cubos cubos{argc, argv};

cubos.plugin(settingsPlugin);
cubos.plugin(assetsPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/assets/saving/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ CUBOS_REFLECT_IMPL(IntegerAsset)
}
/// [Asset type]

int main()
int main(int argc, char** argv)
{
Cubos cubos{};
Cubos cubos{argc, argv};

cubos.plugin(settingsPlugin);
cubos.plugin(assetsPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/collisions/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ struct State
glm::vec3 bRotationAxis;
};

int main()
int main(int argc, char** argv)
{
auto cubos = Cubos();
auto cubos = Cubos(argc, argv);

cubos.plugin(settingsPlugin);
cubos.plugin(windowPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/events/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ struct State
int step;
};

int main()
int main(int argc, char** argv)
{
cubos::engine::Cubos cubos;
cubos::engine::Cubos cubos(argc, argv);
cubos.resource<State>(State{.step = 0});

/// [Adding event]
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/games/cubosurfers/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ static const Asset<Scene> SceneAsset = AnyAsset("ee5bb451-05b7-430f-a641-a746f70
static const Asset<VoxelPalette> PaletteAsset = AnyAsset("101da567-3d23-46ae-a391-c10ec00e8718");
static const Asset<InputBindings> InputBindingsAsset = AnyAsset("b20900a4-20ee-4caa-8830-14585050bead");

int main()
int main(int argc, char** argv)
{
Cubos cubos{};
Cubos cubos{argc, argv};

cubos.plugin(defaultsPlugin);
cubos.plugin(spawnerPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/hello-cubos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ CUBOS_DEFINE_TAG(cubos::engine::helloTag);
CUBOS_DEFINE_TAG(cubos::engine::worldTag);

/// [Engine]
int main()
int main(int argc, char** argv)
{
Cubos cubos{};
Cubos cubos{argc, argv};
/// [Engine]

/// [Hello Cubos]
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/imgui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ CUBOS_REFLECT_IMPL(DummyResource)
}
/// [Creating a dummy resource]

int main()
int main(int argc, char** argv)
{
Cubos cubos{};
Cubos cubos{argc, argv};

/// [Adding the plugin]
cubos.plugin(settingsPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/input/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ static void showcaseMouseButtons(const Input& input, bool& explained)
}
/// [Showcase Mouse Buttons]

int main()
int main(int argc, char** argv)
{
auto cubos = Cubos();
auto cubos = Cubos(argc, argv);

/// [Adding the plugin]
cubos.plugin(settingsPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/render/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ using namespace cubos::engine;
static const Asset<Scene> SceneAsset = AnyAsset("05db7643-a8b8-49cd-8c16-0992136cfacf");
static const Asset<VoxelPalette> PaletteAsset = AnyAsset("1aa5e234-28cb-4386-99b4-39386b0fc215");

int main()
int main(int argc, char** argv)
{
Cubos cubos{};
Cubos cubos{argc, argv};

/// [Adding the plugins]
cubos.plugin(settingsPlugin);
Expand Down
4 changes: 2 additions & 2 deletions engine/samples/render/shadows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ CUBOS_REFLECT_IMPL(Spin)
return cubos::core::ecs::TypeBuilder<Spin>("Spin").build();
}

int main()
int main(int argc, char** argv)
{
Cubos cubos{};
Cubos cubos{argc, argv};

cubos.component<Spin>();

Expand Down

0 comments on commit 4a09cb2

Please sign in to comment.