KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
EditorLayer.h
1#pragma once
2
3#include "Karma.h"
4#include "Karma/EntryPoint.h"
5
6namespace Karma
7{
8 class EditorLayer : public Layer
9 {
10 public:
11 EditorLayer();
12 ~EditorLayer();
13
14 virtual void OnAttach() override;
15 virtual void OnDetach() override;
16 virtual void OnUpdate(float deltaTime) override;
17 virtual void KarmaGuiRender(float deltaTime) override;
18
19 void OpenScene(const std::string& objFileName);
20 virtual void OnEvent(Event& event) override;
21 bool OnMouseButtonPressed(MouseButtonPressedEvent& e);
22 bool OnMouseButtonReleased(MouseButtonReleasedEvent& e);
23 bool OnKeyPressed(KeyPressedEvent& e);
24 void InputPolling(float deltaTime);
25
26 void TentativeTrigger();
27 void IterateActors();
28
29 private:
30 std::shared_ptr<Karma::Shader> m_ModelShader;
31 std::shared_ptr<Karma::VertexArray> m_ModelVertexArray;
32 std::shared_ptr<Karma::Material> m_ModelMaterial;
33 std::shared_ptr<Karma::Texture> m_ModelTexture;
34
35 std::shared_ptr<Karma::PerspectiveCamera> m_EditorCamera;
36 std::shared_ptr<Karma::Scene> m_EditorScene;
37
38 float cameraTranslationSpeed = 1.0f;
39 float cameraRotationSpeed = 80.0f;
40
41 // Tentative stuff
42 UWorld* testWorld;
43 uint32_t m_ActorCounter;
44 };
45}
This file contains the main() routine with multiplatform support.
virtual void OnDetach() override
A function called on Layer when the LayerStack is destroyed.
Definition EditorLayer.cpp:103
virtual void OnAttach() override
A function called on Layer when the Layer is pushed or OverLay is pushed.
Definition EditorLayer.cpp:86
virtual void KarmaGuiRender(float deltaTime) override
Function called in each game loop, specifically for rendering purposes.
Definition EditorLayer.cpp:114
virtual void OnEvent(Event &event) override
For dispatching Events specific to the Layer.
Definition EditorLayer.cpp:183
virtual void OnUpdate(float deltaTime) override
Function called in each game loop.
Definition EditorLayer.cpp:108
The base class of all the events for Karma.
Definition Event.h:90
Event triggered when the keyboard key is pressed.
Definition KeyEvent.h:53
Layer(const std::string &name="Layer")
A constructor.
Definition Layer.cpp:5
Event triggered when the mouse button is pressed.
Definition MouseEvent.h:136
Event triggered when the mouse button is released.
Definition MouseEvent.h:169
The World is the top level object representing a map or a sandbox in which Actors and Components will...
Definition World.h:150