|
QuasarEngine
Cross-platform 3D engine and editor
|
Part of an application that is updated, rendered and receives events. More...
#include <quasar/core/Layer.h>
Public Member Functions | |
| Layer (const Layer &)=delete | |
| Layer & | operator= (const Layer &)=delete |
| Layer (Layer &&)=delete | |
| Layer & | operator= (Layer &&)=delete |
| virtual void | OnAttach () |
| Called once when the layer is added to the application, before any other hook. | |
| virtual void | OnDetach () |
| Called once when the layer is removed from the application, after every other hook. | |
| virtual void | OnUpdate (Timestep timestep) |
| Called once per frame to update the layer. | |
| virtual void | OnRender () |
| Called once per frame, after OnUpdate(), to render the layer. | |
| virtual void | OnImGuiRender () |
| Called once per frame, after OnRender(), to draw the ImGui windows of the layer. | |
| virtual void | OnEvent (Event &event) |
| Called for each event received by the layer. | |
| const std::string & | GetName () const |
| Returns the name of the layer, for debugging. | |
Protected Member Functions | |
| Layer (std::string name="Layer") | |
| Creates a layer with a name, used in logs and debugging tools. | |
Part of an application that is updated, rendered and receives events.
An application is made of layers, for example the game scene, then the editor panels on top of it. Each layer derives from this class and only overrides the hooks it needs: all of them do nothing by default.
A layer cannot be copied or moved, because the application keeps it at the same address while it is attached.
|
inlinevirtual |
Called once when the layer is added to the application, before any other hook.
Reimplemented in Quasar::ImGuiLayer.
|
inlinevirtual |
Called once when the layer is removed from the application, after every other hook.
Reimplemented in Quasar::ImGuiLayer.
|
inlinevirtual |
Called once per frame to update the layer.
| timestep | Time elapsed since the previous frame. |
|
inlinevirtual |
Called for each event received by the layer.
Mark the event as handled to stop it from reaching the layers below this one.
Reimplemented in Quasar::ImGuiLayer.