diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-11 22:01:53 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-11 22:01:53 +0100 |
commit | f06be6004ec8b47e3b4b1ba4fda068b365923683 (patch) | |
tree | 26376513f8a52386e6127af324aa65177b620620 /src/doc/feature | |
parent | a6803980f1e74ecf1abb007b7c77f00d2cd92c43 (diff) |
update doxygen documentation w/ updated APIloek/doxygen
Diffstat (limited to 'src/doc/feature')
-rw-r--r-- | src/doc/feature/config.dox | 4 | ||||
-rw-r--r-- | src/doc/feature/scene.dox | 15 | ||||
-rw-r--r-- | src/doc/feature/script.dox | 14 | ||||
-rw-r--r-- | src/doc/feature/script_ecs.dox | 6 |
4 files changed, 20 insertions, 19 deletions
diff --git a/src/doc/feature/config.dox b/src/doc/feature/config.dox index 85d6803..ae3a054 100644 --- a/src/doc/feature/config.dox +++ b/src/doc/feature/config.dox @@ -54,8 +54,8 @@ tr td:first-child { font-family: monospace; } |\ref Config::log::level ".log.level"|\copybrief Config::log::level| |\ref Config::physics::gravity ".physics.gravity"|\copybrief Config::physics::gravity| |\ref Config::savemgr::location ".savemgr.location"|\copybrief Config::savemgr::location| -|\ref Config::window::size ".window.size"|\copybrief Config::window::size| -|\ref Config::window::title ".window.title"|\copybrief Config::window::title| +|\ref Config::window_settings::default_size ".window_settings.default_size"|\copybrief Config::window_settings::default_size| +|\ref Config::window_settings::window_title ".window_settings.window_title"|\copybrief Config::window_settings::window_title| */ } diff --git a/src/doc/feature/scene.dox b/src/doc/feature/scene.dox index 4124e37..b680eec 100644 --- a/src/doc/feature/scene.dox +++ b/src/doc/feature/scene.dox @@ -40,31 +40,28 @@ added to the loop/scene manger via loop_mgr::add_scene<>(). The templated argument should define the concrete scene to be added. ```cpp -#include <crepe/api/LoopManager.h> -#include <crepe/api/GameObject.h> +#include <crepe/api/Engine.h> #include <crepe/api/Scene.h> -#include <crepe/types.h> using namespace crepe; class MyScene : public Scene { public: void load_scene() { - ComponentManager & mgr = this->component_manager; - GameObject object1 = mgr.new_object("object1", "tag_my_scene", vec2{0, 0}, 0, 1); - GameObject object2 = mgr.new_object("object2", "tag_my_scene", vec2{1, 0}, 0, 1); + GameObject object1 = new_object("object1", "tag_my_scene", vec2{0, 0}, 0, 1); + GameObject object2 = new_object("object2", "tag_my_scene", vec2{1, 0}, 0, 1); } string get_name() const { return "my_scene"; } }; int main() { - LoopManager loop_mgr; + Engine foo; // Add the scenes to the loop manager - loop_mgr.add_scene<MyScene>(); + foo.add_scene<MyScene>(); - loop_mgr.start(); + return foo.main(); } ``` diff --git a/src/doc/feature/script.dox b/src/doc/feature/script.dox index e3b5508..162b0f5 100644 --- a/src/doc/feature/script.dox +++ b/src/doc/feature/script.dox @@ -21,10 +21,10 @@ BehaviorScript \ref Component "component". \"\ref feature_gameobject\" first. First, define a class (anywhere) that inherits from Script. The Script class -acts as an interface, and has two functions (\ref Script::init "\c init()" and -\ref Script::update "\c update()"), which *may* be implemented (they are empty -by default). From now on, this derivative class will be referred to as a -*concrete script*. +acts as an interface, and has three functions (\ref Script::init "\c init()", +\ref Script::fixed_update "\c fixed_update()" and \ref Script::frame_update +"\c frame_update()"), which *may* be implemented (they are empty by default). +From now on, this derivative class will be referred to as a *concrete script*. ```cpp #include <crepe/api/Script.h> @@ -34,9 +34,13 @@ class MyScript : public crepe::Script { void init() { // called once } - void update() { + + void fixed_update(crepe::duration_t delta_time) { // called on fixed update } + void frame_update(crepe::duration_t delta_time) { + // called for every rendered frame + } }; ``` diff --git a/src/doc/feature/script_ecs.dox b/src/doc/feature/script_ecs.dox index bbe1abc..8bd3376 100644 --- a/src/doc/feature/script_ecs.dox +++ b/src/doc/feature/script_ecs.dox @@ -40,14 +40,14 @@ using namespace crepe; class MyScript : public Script { void show_self() { Metadata & own_metadata = get_component<Metadata>(); - Log::logf("My name is {}", own_metadata.name); + logf("My name is {}", own_metadata.name); } void list_enemies() { RefVector<Metadata> enemies = get_components_by_tag<Metadata>("enemy"); - Log::logf("There are {} enemies:", enemies.size()); + logf("There are {} enemies:", enemies.size()); for (const Metadata & enemy : enemies) { - Log::logf("- {}", enemy.name); + logf("- {}", enemy.name); } } }; |