|
cat3d
A tiny OpenGL 3D engine library written in and for C++.
|
cat3d node for timing the call of a function. More...
#include <timer.hpp>
Inherits cat3d::scene::node.
Public Member Functions | |
| timer (std::function< void(util::time dt)> fn, util::time interval=util::time(), int ct=-1) | |
| Run a function on a timer. More... | |
Public Member Functions inherited from cat3d::scene::node | |
| virtual | ~node () |
| virtual destructor for polymorphism | |
| void | delete_child (node *child) |
| Remove the given child node. More... | |
| util::transform | global_transform () const |
| Get this node's transform relative to the world. | |
| util::transform | local_transform () const |
| Get the node's transform relative to itself. | |
| util::transform & | transform () |
| Access to the underlying transform. More... | |
| void | update (window &win) |
| Called once per frame. Updates this node. | |
| void | render (window &win) |
| Called once per render. Renders this node and all children. | |
| node * | parent () const |
| Get this node's parent. More... | |
| node * | create_node () |
| Create a child node. More... | |
| template<typename Obj , typename... Args> | |
| Obj * | create (Args... args) |
| Add a derived node class as a child. More... | |
| size_t | bind (node_bind_loc loc, std::function< void()> fn) |
| Add a hook into the update cycle of the node. More... | |
| void | unbind (size_t id) |
| Unbind a hook from the node. More... | |
Protected Member Functions | |
| void | update_self (window &win) |
| Overridden by child classes to implement custom behavior. More... | |
Protected Member Functions inherited from cat3d::scene::node | |
| virtual void | render_self (window &win) |
| Overridden by child classes to implement custom rendering. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from cat3d::scene::node | |
| static node * | new_root () |
| Create a new root scene node. More... | |
cat3d node for timing the call of a function.
| cat3d::obj::timer::timer | ( | std::function< void(util::time dt)> | fn, |
| util::time | interval = util::time(), |
||
| int | ct = -1 |
||
| ) |
Run a function on a timer.
| fn | The function to call |
| interval | The time between each call |
| ct | How many times to run the function before terminating, -1 = infinite. |
|
protectedvirtual |
Overridden by child classes to implement custom behavior.
| win | The main cat3d window. |
Reimplemented from cat3d::scene::node.