Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine.
GitHub | Vesper Updates | Creator
Loading...
Searching...
No Matches
SceneSerializer.h
Go to the documentation of this file.
1#pragma once
2#include "Vesper/Core/Base.h"
3#include "Scene.h"
4
5namespace Vesper {
7 {
8 public:
9 SceneSerializer(const Ref<Scene>& scene);
10
11 void Serialize(const std::string& filepath);
12 void SerializeRuntime(const std::string& filepath);
13
14 bool Deserialize(const std::string& filepath);
15 bool DeserializeRuntime(const std::string& filepath);
16 private:
18 };
19}
#define VZ_CORE_ASSERT(x,...)
Definition Asserts.h:20
#define VZ_BIND_EVENT_FN(fn)
Binds a member function as an event handler.
Definition Defines_Macros.h:17
#define EVENT_CLASS_TYPE(type)
Macro to define event type in event subclasses.
Definition Defines_Macros.h:25
#define EVENT_CLASS_CATEGORY(category)
Macro to define event category in event subclasses.
Definition Defines_Macros.h:31
#define BIT(x)
Macro to shift 1 by x positions to create a bitmask.
Definition Defines_Macros.h:13
static const uint32_t s_MapHeight
Definition EditorLayer.cpp:13
static const char * s_MapTiles
Definition EditorLayer.cpp:14
static const uint32_t s_MapWidth
Definition EditorLayer.cpp:12
#define VZ_PROFILE
Definition Instrumentor.h:211
#define VZ_FUNC_SIG
Definition Instrumentor.h:231
#define VZ_PROFILE_SCOPE_LINE2(name, line)
Definition Instrumentor.h:236
#define VZ_PROFILE_FUNCTION()
Definition Instrumentor.h:240
#define VZ_PROFILE_SCOPE(name)
Definition Instrumentor.h:239
#define VZ_PROFILE_SCOPE_LINE(name, line)
Definition Instrumentor.h:238
#define VZ_CORE_INFO(...)
info: general information about application flow
Definition Log.h:37
#define VZ_CORE_ERROR(...)
error: indicates an error that has occurred
Definition Log.h:41
Event for registering application render.
Definition ApplicationEvent.h:82
AppRenderEvent()
Definition ApplicationEvent.h:84
Event for registering application tick.
Definition ApplicationEvent.h:60
AppTickEvent()
Definition ApplicationEvent.h:62
Event for registering application update.
Definition ApplicationEvent.h:71
AppUpdateEvent()
Definition ApplicationEvent.h:73
The core application class that manages the main loop, window, layers, and event handling.
Definition Application.h:35
static Application * s_Instance
Definition Application.h:92
void OnEvent(Event &e)
Handles incoming events and dispatches them to the appropriate handlers.
Definition Application.cpp:60
float m_LastFrameTime
Time of the last frame, used for calculating timestep.
Definition Application.h:89
bool OnWindowResize(WindowResizeEvent &e)
Event handler for window resize events.
Definition Application.cpp:118
static Application & Get()
Retrieves the singleton instance of the Application.
Definition Application.h:67
ImGuiLayer * m_ImGuiLayer
ImGui layer for rendering GUI elements.
Definition Application.h:81
bool m_Running
Flag indicating whether the application is running.
Definition Application.h:83
bool OnWindowClose(WindowCloseEvent &e)
Event handler for window close events.
Definition Application.cpp:111
ImGuiLayer * GetImGuiLayer()
Retrieves the ImGui layer.
Definition Application.h:64
void Run()
Starts the main application loop.
Definition Application.cpp:77
void PushLayer(Layer *layer)
Adds a layer to the application layer stack.
Definition Application.cpp:41
Application(const std::string &name="")
Constructs the Application with the given name.
Definition Application.cpp:17
LayerStack m_LayerStack
Stack of layers managed by the application.
Definition Application.h:87
void PushOverlay(Layer *overlay)
Adds an overlay layer to the application layer stack.
Definition Application.cpp:48
virtual ~Application()
Definition Application.cpp:37
Scope< Window > m_Window
Scoped pointer to the applications underlying window.
Definition Application.h:79
bool m_Minimized
Flag indicating whether the application is minimized.
Definition Application.h:85
void Close()
Closes the application.
Definition Application.cpp:55
Window & GetWindow()
Retrieves the application window.
Definition Application.h:70
Represents the layout of a buffer, consisting of multiple BufferElements.
Definition Buffer.h:84
uint32_t m_Stride
Definition Buffer.h:125
const std::vector< BufferElement > & GetElements() const
Returns the list of BufferElements in the layout.
Definition Buffer.h:100
uint32_t GetStride() const
Returns the stride (total size in bytes) of the buffer layout.
Definition Buffer.h:102
BufferLayout(const std::initializer_list< BufferElement > &elements)
Constructs a BufferLayout with the given list of BufferElements.
Definition Buffer.h:92
BufferLayout()
Definition Buffer.h:86
Definition Camera.h:7
Camera()=default
const glm::mat4 & GetProjection() const
Definition Camera.h:15
~Camera()=default
glm::mat4 m_Projection
Definition Camera.h:17
Camera(const glm::mat4 &projection)
Definition Camera.h:10
Definition EditorCamera.h:13
const glm::mat4 & GetViewProjection() const
Definition EditorCamera.h:26
void SetViewportSize(float width, float height)
Definition EditorCamera.h:23
float m_ViewportHeight
Definition EditorCamera.h:70
void MousePan(const glm::vec2 &delta)
Definition EditorCamera.cpp:95
glm::vec3 GetForwardDirection() const
Definition EditorCamera.cpp:133
void UpdateView()
Definition EditorCamera.cpp:77
void SetYaw(float yaw)
Definition EditorCamera.h:40
const glm::mat4 & GetViewMatrix() const
Definition EditorCamera.h:25
float m_NearClip
Definition EditorCamera.h:59
glm::vec3 m_Position
Definition EditorCamera.h:62
float m_Yaw
Definition EditorCamera.h:68
float m_Pitch
Definition EditorCamera.h:68
float GetDistance() const
Definition EditorCamera.h:20
void SetPitch(float pitch)
Definition EditorCamera.h:37
void OnUpdate(Timestep ts)
Definition EditorCamera.cpp:46
float m_FarClip
Definition EditorCamera.h:59
void SetDistance(float distance)
Definition EditorCamera.h:21
const glm::vec3 & GetPosition() const
Definition EditorCamera.h:33
std::pair< float, float > PanSpeed() const
Definition EditorCamera.cpp:21
float m_Distance
Definition EditorCamera.h:67
glm::vec2 m_InitialMousePosition
Definition EditorCamera.h:65
glm::mat4 m_ViewMatrix
Definition EditorCamera.h:61
float m_FOV
Definition EditorCamera.h:59
glm::quat GetOrientation() const
Definition EditorCamera.cpp:137
float GetYaw() const
Definition EditorCamera.h:39
bool OnMouseScroll(MouseScrolledEvent &e)
Definition EditorCamera.cpp:87
void MouseZoom(float delta)
Definition EditorCamera.cpp:109
void SetPosition(const glm::vec3 &position)
float m_AspectRatio
Definition EditorCamera.h:59
EditorCamera()
Definition EditorCamera.cpp:12
float m_ViewportWidth
Definition EditorCamera.h:70
float ZoomSpeed() const
Definition EditorCamera.cpp:37
glm::vec3 CalculatePosition() const
Definition EditorCamera.cpp:119
float GetPitch() const
Definition EditorCamera.h:36
void OnEvent(Event &e)
Definition EditorCamera.cpp:65
void MouseRotate(const glm::vec2 &delta)
Definition EditorCamera.cpp:102
glm::vec3 GetRightDirection() const
Definition EditorCamera.cpp:129
float RotationSpeed() const
Definition EditorCamera.cpp:32
glm::vec3 GetUpDirection() const
Definition EditorCamera.cpp:124
glm::vec3 m_FocalPoint
Definition EditorCamera.h:63
EditorCamera(float fov, float aspectRation, float nearClip, float farClip)
Definition EditorCamera.cpp:15
void UpdateProjection()
Definition EditorCamera.cpp:71
Definition EditorLayer.h:14
glm::vec4 m_SpecialQuadColor
Definition EditorLayer.h:98
bool m_ViewportFocused
Definition EditorLayer.h:44
float m_RotationSnap
Definition EditorLayer.h:51
std::unordered_map< char, Ref< SubTexture2D > > s_TextureMap
Definition EditorLayer.h:101
Ref< Shader > m_FlatColorShader
Definition EditorLayer.h:60
void OpenScene()
Definition EditorLayer.cpp:728
glm::vec4 m_TextureTintColor1
Definition EditorLayer.h:94
float lastFrameTime
Definition EditorLayer.h:55
ParticleProps m_ParticleProps
Definition EditorLayer.h:87
glm::vec4 m_ClearColor
Definition EditorLayer.h:97
SceneState
Definition EditorLayer.h:39
@ Simulate
Definition EditorLayer.h:40
@ Edit
Definition EditorLayer.h:40
@ Play
Definition EditorLayer.h:40
bool scene3
Definition EditorLayer.h:90
Ref< SubTexture2D > m_SubTextureSmoke
Definition EditorLayer.h:71
Ref< Texture2D > m_SpriteSheetCursedLands
Definition EditorLayer.h:68
int m_GizmoType
Definition EditorLayer.h:50
bool scene4
Definition EditorLayer.h:90
ParticleSystem m_ParticleSystem
Definition EditorLayer.h:86
EditorLayer()
Definition EditorLayer.cpp:37
EditorCamera m_EditorCamera
Definition EditorLayer.h:79
Ref< Texture2D > m_SpriteSheetCrystals
Definition EditorLayer.h:66
float m_ScaleSnap
Definition EditorLayer.h:51
void NewScene()
Definition EditorLayer.cpp:721
float m_TranslationSnap
Definition EditorLayer.h:51
glm::vec4 m_SquareColor
Definition EditorLayer.h:93
glm::vec2 m_ViewportSize
Definition EditorLayer.h:45
bool OnKeyPressed(KeyPressedEvent &e)
Definition EditorLayer.cpp:669
bool m_PrimaryCamera
Definition EditorLayer.h:47
float m_squareRotation
Definition EditorLayer.h:82
OrthographicCameraController m_CameraController
Definition EditorLayer.h:53
Ref< Scene > m_ActiveScene
Definition EditorLayer.h:35
glm::vec4 m_TextureTintColor2
Definition EditorLayer.h:95
Ref< SubTexture2D > m_SubTextureTown
Definition EditorLayer.h:72
bool m_UseSpecialQuadColor
Definition EditorLayer.h:99
Ref< Scene > m_EditorScene
Definition EditorLayer.h:36
glm::vec4 m_BackgroundColor
Definition EditorLayer.h:96
Ref< Texture2D > m_CheckerboardTexture
Definition EditorLayer.h:61
Entity m_CameraEntity
Definition EditorLayer.h:48
Ref< VertexArray > m_SquareVA
Definition EditorLayer.h:59
virtual void OnEvent(Event &e) override
Called when an event is dispatched to the layer.
Definition EditorLayer.cpp:657
int ParticleEmitCount
Definition EditorLayer.h:84
SceneState m_SceneState
Definition EditorLayer.h:42
virtual void OnUpdate(Timestep ts) override
Called every frame to update the layer with the given timestep.
Definition EditorLayer.cpp:234
float m_textureScale
Definition EditorLayer.h:81
SceneHierarchyPanel m_SceneHierarchyPanel
Definition EditorLayer.h:33
Ref< Texture2D > m_SpriteSheetRocks
Definition EditorLayer.h:67
Ref< SubTexture2D > m_SubTextureFire
Definition EditorLayer.h:70
float m_specialQuadRotation
Definition EditorLayer.h:83
virtual void OnAttach() override
Called when the layer is attached to the application.
Definition EditorLayer.cpp:45
bool scene1
Definition EditorLayer.h:90
void SaveSceneAs()
Definition EditorLayer.cpp:744
bool useEntityScene
Definition EditorLayer.h:91
Entity m_SmokeEntity
Definition EditorLayer.h:56
bool scene2
Definition EditorLayer.h:90
Entity m_FireEntity
Definition EditorLayer.h:56
Ref< Framebuffer > m_Framebuffer
Definition EditorLayer.h:77
bool m_ViewportHovered
Definition EditorLayer.h:44
Ref< Texture2D > m_SpriteSheetFire
Definition EditorLayer.h:63
virtual ~EditorLayer()=default
Ref< Texture2D > m_SpriteSheetSmoke
Definition EditorLayer.h:64
virtual void OnDetach() override
Called when the layer is detached from the application.
Definition EditorLayer.cpp:229
virtual void OnImGuiRender() override
Called when the layer should render its ImGui components.
Definition EditorLayer.cpp:425
Ref< Texture2D > m_SpriteSheetTown
Definition EditorLayer.h:65
void ResetScene()
Definition EditorLayer.cpp:755
Represents an entity in a scene.
Definition Entity.h:14
T & GetComponent()
Definition Entity.h:70
Entity(entt::entity handle, Scene *scene)
Constructs an Entity with the given handle and scene.
Definition Entity.cpp:6
const std::string & GetName()
Definition Entity.h:112
T & GetOrAddComponent(Args &&... args)
Definition Entity.h:83
T & AddComponent(Args &&... args)
Definition Entity.h:45
const UUID & GetID()
Definition Entity.h:104
T & AddOrReplaceComponent(Args &&... args)
Definition Entity.h:60
Entity()=default
bool HasComponent() const
Definition Entity.h:33
Scene * m_Scene
Pointer to the scene that contains the entity.
Definition Entity.h:128
operator bool() const
Definition Entity.h:118
Entity(const Entity &other)=default
Copy constructor for Entity.
void RemoveComponent()
Definition Entity.h:95
Stack-based templated event dispatcher.
Definition Event.h:68
EventDispatcher(Event &event)
Construct an EventDispatcher for a specific event.
Definition Event.h:78
Event & m_Event
The event to be dispatched.
Definition Event.h:100
bool Dispatch(EventFn< T > func)
Dispatch the event to the appropriate handler if the types match.
Definition Event.h:89
Abstract base class for all events.
Definition Event.h:37
bool IsInCategory(EventCategory category)
Check if the event is in a specific category.
Definition Event.h:55
virtual ~Event()=default
virtual int GetCategoryFlags() const =0
Get the category flags of the event.
virtual EventType GetEventType() const =0
Get the type of the event.
virtual std::string ToString() const
Convert the event to a string representation.
Definition Event.h:52
bool Handled
Indicates whether the event has been handled.
Definition Event.h:62
virtual const char * GetName() const =0
Get the name of the event.
Cross-platform file dialog utilities.
Definition PlatformUtils.h:10
static std::string SaveFile(const char *filter)
Opens a file dialog to select a location to save a file.
Definition WindowsPlatformUtils.cpp:29
static std::string OpenFile(const char *filter)
Opens a file dialog to select a file to open.
Definition WindowsPlatformUtils.cpp:12
Definition PlatformUtils.h:28
static void Initialize()
Definition WindowsPlatformUtils.cpp:66
static std::string m_RootEditorDirectory
Definition PlatformUtils.h:38
static std::string m_ProjectsDirectory
Definition PlatformUtils.h:41
static std::string GetCurrentWorkingDirectory()
Definition WindowsPlatformUtils.cpp:97
static std::string m_AssetsDirectory
Definition PlatformUtils.h:40
static std::string m_ResourcesDirectory
Definition PlatformUtils.h:39
static std::string GetTravelingUpPath(const std::string &path)
Definition WindowsPlatformUtils.cpp:112
static std::string m_RootEngineDirectory
Definition PlatformUtils.h:37
static std::string m_CurrentProjectDirectory
Definition PlatformUtils.h:42
static std::string GetAbsolutePath(const std::string &relativePath)
Definition WindowsPlatformUtils.cpp:104
static bool m_Initialized
Definition PlatformUtils.h:36
static bool IsInitialized()
Definition PlatformUtils.h:34
Abstract class representing a framebuffer.
Definition Framebuffer.h:21
static Ref< Framebuffer > Create(const FramebufferSpecification &spec)
Creates a framebuffer with the given specification.
Definition Framebuffer.cpp:9
virtual void Unbind()=0
~Framebuffer()=default
virtual void Bind()=0
virtual void Resize(uint32_t width, uint32_t height)=0
Resizes the framebuffer to the given width and height.
virtual uint32_t GetColorAttachmentRendererID() const =0
Returns the renderer ID of the color attachment texture.
virtual const FramebufferSpecification & GetSpecification() const =0
Returns the specification used to create the framebuffer.
Definition ImGuiLayer.h:13
~ImGuiLayer()
Definition ImGuiLayer.cpp:25
virtual void OnEvent(Event &e) override
Called when an event is dispatched to the layer.
Definition ImGuiLayer.cpp:86
ImGuiLayer()
Definition ImGuiLayer.cpp:21
virtual void Begin()
Definition ImGuiLayer.cpp:95
virtual void OnDetach() override
Called when the layer is detached from the application.
Definition ImGuiLayer.cpp:69
virtual void OnImGuiRender() override
Called when the layer should render its ImGui components.
Definition ImGuiLayer.cpp:81
virtual void SetDarkThemeColors()
Definition ImGuiLayer.cpp:120
float m_Time
Definition ImGuiLayer.h:30
bool m_BlockEvents
Definition ImGuiLayer.h:29
virtual void End()
Definition ImGuiLayer.cpp:104
virtual void OnAttach() override
Called when the layer is attached to the application.
Definition ImGuiLayer.cpp:29
virtual void SetBlockEvents(bool block)
Definition ImGuiLayer.h:26
Abstract base class for an index buffer.
Definition Buffer.h:154
virtual void Bind() const =0
virtual uint32_t GetCount() const =0
virtual void Unbind() const =0
virtual ~IndexBuffer()
Definition Buffer.h:156
static Ref< IndexBuffer > Create(uint32_t *indices, uint32_t count)
Definition Buffer.cpp:33
Base input class for querying input states.
Definition Input.h:12
static bool IsMouseButtonPressed(int button)
Checks if the specified mouse button is currently pressed.
Definition WindowsInput.cpp:16
static float GetMouseY()
Gets the current Y position of the mouse cursor.
Definition WindowsInput.cpp:36
Input()=default
Input & operator=(const Input &)=delete
static glm::vec2 GetMousePosition()
Gets the current position of the mouse cursor as a 2D vector.
Definition WindowsInput.cpp:23
static bool IsKeyPressed(int keycode)
Checks if the specified key is currently pressed.
Definition WindowsInput.cpp:9
Input(const Input &)=delete
static float GetMouseX()
Gets the current X position of the mouse cursor.
Definition WindowsInput.cpp:32
Base class for keyboard events.
Definition KeyEvent.h:16
int m_KeyCode
Definition KeyEvent.h:31
int GetKeyCode() const
Get the key code associated with the event.
Definition KeyEvent.h:20
KeyEvent(int keycode)
Construct a KeyEvent with the specified key code.
Definition KeyEvent.h:29
Event for registering key press.
Definition KeyEvent.h:37
int m_RepeatCount
Definition KeyEvent.h:60
int GetRepeatCount() const
Get the repeat count of the key press event.
Definition KeyEvent.h:48
std::string ToString() const override
Convert the event to a string representation.
Definition KeyEvent.h:51
KeyPressedEvent(int keycode, int repeatCount)
Construct a KeyPressedEvent with the specified key code and repeat count.
Definition KeyEvent.h:44
Event for registering key release.
Definition KeyEvent.h:66
std::string ToString() const override
Convert the event to a string representation.
Definition KeyEvent.h:75
KeyReleasedEvent(int keycode)
Construct a KeyReleasedEvent with the specified key code.
Definition KeyEvent.h:71
Event for registering key typing.
Definition KeyEvent.h:88
KeyTypedEvent(int keycode)
Construct a KeyTypedEvent with the specified key code.
Definition KeyEvent.h:93
std::string ToString() const override
Convert the event to a string representation.
Definition KeyEvent.h:98
Represents a reusable application layer that receives lifecycle callbacks (attach,...
Definition Layer.h:17
virtual void OnEvent(Event &event)
Called when an event is dispatched to the layer.
Definition Layer.h:41
const std::string & GetName() const
Retrieves the name of the layer for debugging purposes.
Definition Layer.h:53
virtual void OnDetach()
Called when the layer is detached from the application.
Definition Layer.h:31
virtual void OnUpdate(Timestep ts)
Called every frame to update the layer with the given timestep.
Definition Layer.h:36
virtual void OnImGuiRender()
Called when the layer should render its ImGui components.
Definition Layer.h:50
Layer(const std::string &name="Layer")
Constructs a Layer with an optional name for debugging purposes.
Definition Layer.cpp:6
virtual ~Layer()
Definition Layer.cpp:11
std::string m_DebugName
The name of the layer assigned at creation, used for debugging.
Definition Layer.h:57
virtual void OnAttach()
Called when the layer is attached to the application.
Definition Layer.h:28
virtual void OnRender()
Called when the layer should render its contents.
Definition Layer.h:47
Manages an ordered stack of Layer pointers. Layers can be pushed or popped and the stack can be itera...
Definition LayerStack.h:16
LayerStack()
Definition LayerStack.cpp:6
void PopOverlay(Layer *overlay)
Removes the specified overlay layer from the stack.
Definition LayerStack.cpp:42
unsigned int m_LayerInsertIndex
Index indicating where to insert new layers (before overlays).
Definition LayerStack.h:55
void PushLayer(Layer *layer)
Adds the layer to the stack at the position before the first overlay.
Definition LayerStack.cpp:19
void PushOverlay(Layer *overlay)
Pushes the overlay layer on top of all other layers.
Definition LayerStack.cpp:26
~LayerStack()
Definition LayerStack.cpp:10
void PopLayer(Layer *layer)
Removes the specified layer from the stack.
Definition LayerStack.cpp:32
Base class for mouse button events.
Definition MouseEvent.h:81
int m_Button
Definition MouseEvent.h:95
int GetMouseButton() const
Get the mouse button associated with the event.
Definition MouseEvent.h:84
MouseButtonEvent(int button)
Construct a MouseButtonEvent with the specified button.
Definition MouseEvent.h:92
Event for registering mouse button presses.
Definition MouseEvent.h:101
MouseButtonPressedEvent(int button)
Construct a MouseButtonPressedEvent with the specified button.
Definition MouseEvent.h:106
std::string ToString() const override
Convert the event to a string representation.
Definition MouseEvent.h:111
Event for registering mouse button releases.
Definition MouseEvent.h:124
MouseButtonReleasedEvent(int button)
Construct a MouseButtonReleasedEvent with the specified button.
Definition MouseEvent.h:130
std::string ToString() const override
Convert the event to a string representation.
Definition MouseEvent.h:135
Event for registering mouse movement.
Definition MouseEvent.h:16
std::string ToString() const override
Convert the event to a string representation.
Definition MouseEvent.h:33
float m_MouseX
Definition MouseEvent.h:43
float m_MouseY
Definition MouseEvent.h:43
float GetX() const
Get the x coordinate of the mouse.
Definition MouseEvent.h:28
MouseMovedEvent(float x, float y)
Construct a MouseMovedEvent with the specified x and y coordinates.
Definition MouseEvent.h:23
float GetY() const
Get the y coordinate of the mouse.
Definition MouseEvent.h:30
Event for registering mouse scroll wheel movement.
Definition MouseEvent.h:49
float m_XOffset
Definition MouseEvent.h:75
float GetXOffset() const
Get the x offset of the mouse scroll.
Definition MouseEvent.h:60
MouseScrolledEvent(float xOffset, float yOffset)
Construct a MouseScrolledEvent with the specified x and y offsets.
Definition MouseEvent.h:55
float GetYOffset() const
Get the y offset of the mouse scroll.
Definition MouseEvent.h:62
std::string ToString() const override
Convert the event to a string representation.
Definition MouseEvent.h:65
float m_YOffset
Definition MouseEvent.h:75
Definition OrthographicCameraController.h:26
void SetAspectRatio(float aspectRatio)
Definition OrthographicCameraController.cpp:128
void SetRotationSpeed(float speed)
Definition OrthographicCameraController.cpp:118
float GetZoomLevel() const
Definition OrthographicCameraController.h:57
void OnResize(float width, float height)
Definition OrthographicCameraController.cpp:56
void CalculateView()
Definition OrthographicCameraController.cpp:95
float m_CameraRotation
Definition OrthographicCameraController.h:75
void SetMoveSpeed(float speed)
Definition OrthographicCameraController.cpp:107
OrthographicCameraController(float aspectRatio, bool rotation=false)
Definition OrthographicCameraController.cpp:13
bool m_Rotation
Definition OrthographicCameraController.h:73
void OnEvent(Event &e)
Definition OrthographicCameraController.cpp:47
glm::vec3 m_CameraPosition
Definition OrthographicCameraController.h:74
float m_CameraMoveSpeed
Definition OrthographicCameraController.h:76
void OnUpdate(Timestep ts)
Definition OrthographicCameraController.cpp:21
void SetZoomLevel(float level)
Definition OrthographicCameraController.h:56
void SetCanRotate(bool canRotate)
Definition OrthographicCameraController.h:54
void UpdateCameraBounds()
Definition OrthographicCameraController.cpp:81
bool CanRotate() const
Definition OrthographicCameraController.h:53
bool OnMouseScrolled(MouseScrolledEvent &e)
Definition OrthographicCameraController.cpp:65
void OnImGuiRender()
TODO: move to an editor component that can be attached to any system (EditorAbstractionComp).
Definition OrthographicCameraController.cpp:136
float m_ZoomLevel
Definition OrthographicCameraController.h:69
void OnUpdateBounds()
Definition OrthographicCameraController.cpp:90
float GetAspectRatio() const
Definition OrthographicCameraController.cpp:123
const OrthographicCamera & GetCamera() const
Definition OrthographicCameraController.h:35
OrthographicCameraBounds GetBounds() const
Definition OrthographicCameraController.h:36
float GetRotationSpeed() const
Definition OrthographicCameraController.h:48
float GetMoveSpeed() const
Definition OrthographicCameraController.h:42
glm::vec3 GetPosition() const
Definition OrthographicCameraController.h:38
OrthographicCameraBounds m_Bounds
Definition OrthographicCameraController.h:71
float m_CameraRotationSpeed
Definition OrthographicCameraController.h:76
void SetPosition(float x, float y)
Definition OrthographicCameraController.cpp:101
float m_AspectRatio
Definition OrthographicCameraController.h:68
OrthographicCamera & GetCamera()
Definition OrthographicCameraController.h:34
float GetRotation() const
Definition OrthographicCameraController.h:45
OrthographicCamera camera
Definition OrthographicCameraController.h:70
bool OnWindowResized(WindowResizeEvent &e)
Definition OrthographicCameraController.cpp:74
void SetRotation(float rotation)
Definition OrthographicCameraController.cpp:112
Definition OrthographicCamera.h:7
glm::mat4 m_ViewProjectionMatrix
Definition OrthographicCamera.h:28
void SetProjection(float left, float right, float bottom, float top)
Definition OrthographicCamera.cpp:15
void SetPosition(const glm::vec3 &position)
Definition OrthographicCamera.h:13
void RecalculateViewMatrix()
Definition OrthographicCamera.cpp:22
glm::mat4 m_ViewMatrix
Definition OrthographicCamera.h:27
const glm::mat4 & GetViewMatrix() const
Definition OrthographicCamera.h:21
const glm::mat4 & GetViewProjectionMatrix() const
Definition OrthographicCamera.h:22
glm::mat4 m_ProjectionMatrix
Definition OrthographicCamera.h:26
const float GetRotation() const
Definition OrthographicCamera.h:17
float m_Rotation
Definition OrthographicCamera.h:31
const glm::vec3 & GetPosition() const
Definition OrthographicCamera.h:14
const glm::mat4 & GetProjectionMatrix() const
Definition OrthographicCamera.h:20
void SetRotation(float rotation)
Definition OrthographicCamera.h:16
OrthographicCamera(float left, float right, float bottom, float top)
Definition OrthographicCamera.cpp:8
glm::vec3 m_Position
Definition OrthographicCamera.h:30
Definition ParticleSystem.h:25
float LifeRemaining
Definition ParticleSystem.h:44
ParticleSystem()
Definition ParticleSystem.cpp:12
void SetParticleProps(const ParticleProps &particleProps)
Definition ParticleSystem.h:33
ParticleSystem(uint32_t maxParticles)
Definition ParticleSystem.cpp:18
uint32_t m_PoolIndex
Definition ParticleSystem.h:48
glm::vec4 ColorBegin
Definition ParticleSystem.h:40
float Rotation
Definition ParticleSystem.h:42
glm::vec3 Position
Definition ParticleSystem.h:38
glm::vec4 ColorEnd
Definition ParticleSystem.h:40
float SizeEnd
Definition ParticleSystem.h:41
float SizeBegin
Definition ParticleSystem.h:41
glm::vec3 Velocity
Definition ParticleSystem.h:39
float LifeTime
Definition ParticleSystem.h:43
void OnRender(OrthographicCamera &camera)
Definition ParticleSystem.cpp:43
void Emit(const ParticleProps &particleProps)
Definition ParticleSystem.cpp:63
std::vector< Particle > m_ParticlePool
Definition ParticleSystem.h:47
void OnUpdate(Timestep ts)
Definition ParticleSystem.cpp:24
ParticleProps m_Props
Definition ParticleSystem.h:49
bool Active
Definition ParticleSystem.h:45
Definition ParticleSystem.h:37
A static class that provides an interface for issuing rendering commands.
Definition RenderCommand.h:10
static void SetClearColor(const glm::vec4 &color)
Sets the clear color for the renderer.
Definition RenderCommand.h:26
static RendererAPI * s_RendererAPI
Definition RenderCommand.h:44
static void SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
Sets the viewport dimensions for the renderer.
Definition RenderCommand.h:20
static void Clear()
Clears the rendering buffers.
Definition RenderCommand.h:32
static void DrawIndexed(const Ref< VertexArray > &vertexArray, uint32_t indexCount=0)
Draws indexed geometry using the specified vertex array and index count.
Definition RenderCommand.h:38
static void Init()
Initializes the rendering API.
Definition RenderCommand.h:14
A 2D renderer for drawing quads and sprites.
Definition Renderer2D.h:17
static void FlushAndReset()
Definition Renderer2D.cpp:507
static Ref< Texture2D > GetWhiteTexture()
Returns a reference to the default white texture that allows for coloring.
Definition Renderer2D.cpp:492
static void ResetStats()
Resets the rendering statistics.
Definition Renderer2D.cpp:497
static void DrawQuadWithTexture(const glm::vec2 &position, const glm::vec2 &size, const Ref< Texture2D > &texture, float tilingFactor, const glm::vec4 tintColor)
Draws a textured quad at the specified position and size.
Definition Renderer2D.cpp:262
static void BeginScene(const OrthographicCamera &camera)
Begins a new scene with the given orthographic camera.
Definition Renderer2D.cpp:148
static void DrawQuadRotatedWithTexture(const glm::mat4 &transform, const Ref< Texture2D > &texture, float tilingFactor, const glm::vec4 tintColor)
Draws a rotated textured quad with the given transform, texture, tiling factor, and tint color.
Definition Renderer2D.cpp:368
static void BeginScene(const EditorCamera &camera)
Begins a new scene with the given editor camera.
Definition Renderer2D.cpp:138
static void EndScene()
Ends the current scene.
Definition Renderer2D.cpp:160
static void BeginScene(const Camera &camera, const glm::mat4 &transform)
Begins a new scene with the given camera and transform.
Definition Renderer2D.cpp:123
static void Init()
Initializes the 2D renderer.
Definition Renderer2D.cpp:55
static void DrawQuadRotated(const glm::vec2 &position, const glm::vec2 &size, float rotationRads, const glm::vec4 &color)
Draws a rotated colored quad at the specified position, size, and rotation.
Definition Renderer2D.cpp:356
static void DrawQuadRotatedWithTexture(const glm::vec2 &position, const glm::vec2 &size, const Ref< Texture2D > &texture, float rotationRads, float tilingFactor, const glm::vec4 tintColor)
Draws a rotated textured quad at the specified position, size, and rotation.
Definition Renderer2D.cpp:409
static void Shutdown()
Shuts down the 2D renderer.
Definition Renderer2D.cpp:116
static void DrawQuad(const glm::vec2 &position, const glm::vec2 &size, const glm::vec4 &color)
Draws a colored quad at the specified position and size.
Definition Renderer2D.cpp:207
static void StartBatch()
Definition Renderer2D.cpp:515
static void DrawQuad(const glm::mat4 &transform, const glm::vec4 &color)
Draws a colored quad with the given transform and color.
Definition Renderer2D.cpp:180
static Statistics GetStats()
Retrieves the current rendering statistics.
Definition Renderer2D.cpp:502
static void DrawQuadRotated(const glm::mat4 &transform, const glm::vec4 &color)
Draws a rotated colored quad with the given transform and color.
Definition Renderer2D.cpp:330
static void Flush()
Flushes the current batch of rendering commands.
Definition Renderer2D.cpp:169
static void DrawQuadWithTexture(const glm::mat4 &transform, const Ref< Texture2D > &texture, float tilingFactor, const glm::vec4 tintColor)
Draws a textured quad with the given transform, texture, tiling factor, and tint color.
Definition Renderer2D.cpp:218
An abstract class defining the interface for a rendering API.
Definition RendererAPI.h:11
static API s_API
Definition RendererAPI.h:36
virtual void DrawIndexed(const Ref< VertexArray > &vertexArray, uint32_t indexCount=0)=0
Draws indexed geometry using the provided vertex array.
virtual void SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height)=0
Sets the viewport dimensions.
virtual void SetClearColor(const glm::vec4 &color)=0
Sets the clear color for the rendering API.
virtual void Clear()=0
Clears the rendering buffers.
virtual void Init()=0
Initializes the rendering API.
virtual ~RendererAPI()=default
API
API.
Definition RendererAPI.h:14
@ None
Definition RendererAPI.h:15
@ OpenGL
Definition RendererAPI.h:16
static API GetAPI()
Returns the current rendering API.
Definition RendererAPI.h:34
The main renderer class responsible for managing rendering operations.
Definition Renderer.h:11
static SceneData * s_SceneData
Pointer to the current scene data.
Definition Renderer.h:50
static void Submit(const Ref< Shader > &shader, const Ref< VertexArray > &vertexArray, const glm::mat4 &transform=glm::mat4(1.0f))
Submits a draw call with the specified shader, vertex array, and transform.
Definition Renderer.cpp:39
static void OnWindowResize(uint32_t width, uint32_t height)
Handles window resize events by resizing the viewport.
Definition Renderer.cpp:21
static void EndScene()
Ends the current scene.
Definition Renderer.cpp:33
static void Init()
Initializes the renderer.
Definition Renderer.cpp:13
static void BeginScene(OrthographicCamera &camera)
Begins a new scene with the given orthographic camera.
Definition Renderer.cpp:27
static RendererAPI::API GetAPI()
Retrieves the current rendering API.
Definition Renderer.h:40
glm::mat4 ViewProjectionMatrix
The combined view-projection matrix for the scene.
Definition Renderer.h:46
Scene data structure containing view-projection matrix.
Definition Renderer.h:44
Definition SceneCamera.h:7
float GetPerspectiveNearClip() const
Definition SceneCamera.h:21
float m_AspectRatio
Definition SceneCamera.h:46
virtual ~SceneCamera()=default
float m_OrthographicFar
Definition SceneCamera.h:44
void SetPerspectiveFarClip(float farClip)
Definition SceneCamera.h:24
float GetOrthographicNearClip() const
Definition SceneCamera.h:28
void SetPerspective(float verticalFOV, float nearClip, float farClip)
Definition SceneCamera.cpp:14
SceneCamera()
Definition SceneCamera.cpp:9
float GetPerspectiveFarClip() const
Definition SceneCamera.h:23
ProjectionType m_ProjectionType
Definition SceneCamera.h:38
void SetViewportSize(uint32_t width, uint32_t height)
Definition SceneCamera.cpp:31
void RecalculateProjection()
Definition SceneCamera.cpp:37
float GetOrthographicSize() const
Definition SceneCamera.h:26
void SetOrthographicSize(float size)
Definition SceneCamera.h:27
float GetOrthographicFarClip() const
Definition SceneCamera.h:30
void SetProjectionType(ProjectionType type)
Definition SceneCamera.h:34
ProjectionType GetProjectionType() const
Definition SceneCamera.h:33
float m_PerspectiveNear
Definition SceneCamera.h:41
void SetPerspectiveNearClip(float nearClip)
Definition SceneCamera.h:22
ProjectionType
Definition SceneCamera.h:9
@ Orthographic
Definition SceneCamera.h:9
@ Perspective
Definition SceneCamera.h:9
float m_OrthographicNear
Definition SceneCamera.h:44
void SetPerspectiveVerticalFOV(float verticalFov)
Definition SceneCamera.h:20
float m_PerspectiveFOV
Definition SceneCamera.h:40
float GetPerspectiveVerticalFOV() const
Definition SceneCamera.h:19
float m_PerspectiveFar
Definition SceneCamera.h:41
float m_OrthographicSize
Definition SceneCamera.h:43
void SetOrthographicNearClip(float nearClip)
Definition SceneCamera.h:29
void SetOrthographic(float size, float nearClip, float farClip)
Definition SceneCamera.cpp:23
void SetOrthographicFarClip(float farClip)
Definition SceneCamera.h:31
Definition Scene.h:13
Entity CreateEntity(const std::string &name, const std::string &uuid)
Definition Scene.cpp:38
const std::string & GetName() const
Definition Scene.h:43
void DestroyEntity(Entity entity)
Definition Scene.cpp:49
uint32_t m_ViewportHeight
Definition Scene.h:35
uint32_t m_ViewportWidth
Definition Scene.h:35
entt::registry m_Registry
Definition Scene.h:34
Entity GetPrimaryCameraEntity()
Definition Scene.cpp:208
void OnUpdateRuntime(Timestep ts)
Definition Scene.cpp:55
std::string m_Name
Definition Scene.h:33
~Scene()
Definition Scene.cpp:23
Scene(const std::string &name)
Definition Scene.cpp:18
void SetName(const std::string &name)
Definition Scene.h:42
Entity CreateEntity(const std::string &name=std::string())
Definition Scene.cpp:27
void OnUpdateEditor(Timestep ts, EditorCamera &camera)
Definition Scene.cpp:150
Scene()
Definition Scene.cpp:11
void OnComponentAdded(Entity entity, T &component)
Definition Scene.cpp:226
void OnViewportResize(uint32_t width, uint32_t height)
Definition Scene.cpp:193
Definition SceneSerializer.h:7
bool Deserialize(const std::string &filepath)
Definition SceneSerializer.cpp:206
void Serialize(const std::string &filepath)
Definition SceneSerializer.cpp:179
SceneSerializer(const Ref< Scene > &scene)
Definition SceneSerializer.cpp:116
void SerializeRuntime(const std::string &filepath)
Definition SceneSerializer.cpp:201
Ref< Scene > m_Scene
Definition SceneSerializer.h:17
bool DeserializeRuntime(const std::string &filepath)
Definition SceneSerializer.cpp:263
Base class for scriptable entities within a scene.
Definition ScriptableEntity.h:11
virtual void OnCreate()
Sets the entity associated with this scriptable entity.
Definition ScriptableEntity.h:31
virtual ~ScriptableEntity()
Definition ScriptableEntity.h:13
Entity m_Entity
Definition ScriptableEntity.h:45
virtual void OnDestroy()
Called when the entity is destroyed.
Definition ScriptableEntity.h:37
T & GetComponent()
Retrieves a reference to a component of type T attached to the entity.
Definition ScriptableEntity.h:21
virtual void OnUpdate(Timestep ts)
Called every frame to update the entity.
Definition ScriptableEntity.h:43
An abstraction for a shader program.
Definition Shader.h:12
virtual void SetInt(const std::string &name, int value)=0
Sets a single integer uniform in the shader.
virtual void SetIntArray(const std::string &name, int *values, uint32_t count)=0
Sets an array of integers uniform in the shader.
virtual void Bind() const =0
connects the shader program for use.
virtual void SetFloat4(const std::string &name, const glm::vec4 &value)=0
Sets a 4-component float vector uniform in the shader.
static Ref< Shader > Create(const std::string &name, const std::string &vertexSrc, const std::string &fragmentSrc)
Definition Shader.cpp:20
static Ref< Shader > Create(const std::string &filepath)
Definition Shader.cpp:9
virtual ~Shader()=default
virtual void Unbind() const =0
disconnects the shader program.
virtual const std::string & GetName() const =0
virtual void SetFloat3(const std::string &name, const glm::vec3 &value)=0
Sets a 3-component float vector uniform in the shader.
virtual void SetMat4(const std::string &name, const glm::mat4 &value)=0
Sets a 4x4 matrix uniform in the shader.
virtual void SetFloat(const std::string &name, float value)=0
Sets a single float uniform in the shader.
A library for managing and storing shaders.
Definition Shader.h:46
Ref< Shader > Load(const std::string &name, const std::string &filepath)
Loads a shader from the specified filepath and adds it to the library with the given name.
Definition Shader.cpp:53
void Add(const Ref< Shader > &shader)
Adds a shader to the library using its own name.
Definition Shader.cpp:38
Ref< Shader > Get(const std::string &name)
Retrieves a shader from the library by name.
Definition Shader.cpp:61
void Add(const std::string &name, const Ref< Shader > &shader)
Adds a shader to the library with the specified name.
Definition Shader.cpp:31
bool Exists(const std::string &name) const
Checks if a shader with the specified name exists in the library.
Definition Shader.cpp:67
std::unordered_map< std::string, Ref< Shader > > m_Shaders
Definition Shader.h:62
Ref< Shader > Load(const std::string &filepath)
Loads a shader from the specified filepath and adds it to the library.
Definition Shader.cpp:45
Represents a sub-region of a 2D texture, useful for sprite sheets.
Definition SubTexture2D.h:13
Ref< Texture2D > m_Texture
The underlying texture of the sub-texture.
Definition SubTexture2D.h:36
const Ref< Texture2D > GetTexture()
Returns the underlying texture of the sub-texture.
Definition SubTexture2D.h:23
SubTexture2D(const Ref< Texture2D > &texture, const glm::vec2 &min, const glm::vec2 &max)
Constructs a SubTexture2D from the given texture and texture coordinates.
Definition SubTexture2D.cpp:8
glm::vec2 * GetTexCoords()
Returns the texture coordinates of the sub-texture.
Definition SubTexture2D.h:25
static Ref< SubTexture2D > CreateFromCoords(const Ref< Texture2D > &texture, const glm::vec2 &coords, const glm::vec2 &cellSize, const glm::vec2 &spriteSize={1, 1})
Creates a SubTexture2D from a grid of cells within the given texture.
Definition SubTexture2D.cpp:17
An abstraction for a 2D texture.
Definition Texture.h:37
static Ref< Texture2D > Create(const std::string &path)
Definition Texture.cpp:21
static Ref< Texture2D > Create(uint32_t width, uint32_t height)
Definition Texture.cpp:10
An abstraction for a texture.
Definition Texture.h:10
virtual uint32_t GetWidth() const =0
Returns the width of the texture.
virtual bool operator==(const Texture2D &other) const =0
virtual std::string GetName() const =0
virtual uint32_t GetHeight() const =0
Returns the height of the texture.
virtual uint32_t GetRendererID() const =0
Returns the renderer ID of the texture.
virtual void SetData(void *data, uint32_t size)=0
Sets the data of the texture.
virtual ~Texture()=default
virtual void Bind(uint32_t slot=0) const =0
Binds the texture to the specified slot for use.
A library for managing and storing textures.
Definition Texture.h:49
void Add(const Ref< Texture2D > &texture)
Adds a texture to the library using its own name.
Definition Texture.cpp:39
Ref< Texture2D > Get(const std::string &name) const
Retrieves a texture from the library by name.
Definition Texture.cpp:62
bool Exists(const std::string &name) const
Checks if a texture with the specified name exists in the library.
Definition Texture.cpp:69
void Add(const std::string &name, const Ref< Texture2D > &texture)
Adds a texture to the library with the specified name.
Definition Texture.cpp:32
Ref< Texture2D > Load(const std::string &name, const std::string &filepath)
Loads a texture from the specified filepath and adds it to the library with the given name.
Definition Texture.cpp:54
std::unordered_map< std::string, Ref< Texture2D > > m_Textures
Definition Texture.h:64
Ref< Texture2D > Load(const std::string &filepath)
Loads a texture from the specified filepath and adds it to the library.
Definition Texture.cpp:46
Represents a time step in seconds.
Definition Timestep.h:12
float GetSeconds() const
Returns the time in seconds.
Definition Timestep.h:26
float m_Time
Definition Timestep.h:30
float GetMilliseconds() const
Returns the time in milliseconds.
Definition Timestep.h:28
operator float() const
Definition Timestep.h:23
Timestep(float time=0.0f)
Constructs a Timestep with the given time in seconds.
Definition Timestep.h:18
An abstraction for a vertex array object (VAO).
Definition VertexArray.h:11
virtual void SetIndexBuffer(const Ref< IndexBuffer > &indexBuffer)=0
Sets the index buffer for the vertex array.
virtual const std::vector< Ref< VertexBuffer > > & GetVertexBuffers()=0
static Ref< VertexArray > Create()
Definition VertexArray.cpp:7
virtual void AddVertexBuffer(const Ref< VertexBuffer > &vertexBuffer)=0
Adds a vertex buffer to the vertex array.
virtual const Ref< IndexBuffer > & GetIndexBuffer() const =0
virtual ~VertexArray()
Definition VertexArray.h:13
virtual void Unbind() const =0
virtual void Bind() const =0
Abstract base class for a vertex buffer.
Definition Buffer.h:132
virtual ~VertexBuffer()
Definition Buffer.h:134
virtual void SetLayout(const BufferLayout &layout)=0
static Ref< VertexBuffer > Create(float *vertices, uint32_t size)
Definition Buffer.cpp:22
virtual void Bind() const =0
virtual void Unbind() const =0
virtual const BufferLayout & GetLayout() const =0
virtual void SetData(const void *data, uint32_t size)=0
static Ref< VertexBuffer > Create(uint32_t size)
Definition Buffer.cpp:11
Event for registering window close.
Definition ApplicationEvent.h:49
WindowCloseEvent()
Definition ApplicationEvent.h:51
Abstract interface representing an application window.
Definition Window.h:43
virtual uint32_t GetWidth() const =0
Retrieves the width of the window.
virtual ~Window()
Definition Window.h:47
virtual void * GetNativeWindow() const =0
Retrieves the native window handle.
static Scope< Window > Create(const WindowProps &props=WindowProps())
Creates a window instance with the specified properties.
Definition WindowsWindow.cpp:20
virtual void SetEventCallback(const EventCallbackFn &callback)=0
Sets the callback function for window events.
virtual void OnUpdate()=0
Called every frame to update the window.
virtual bool IsVSync() const =0
Checks if vertical synchronization (VSync) is enabled.
virtual void SetVSync(bool enabled)=0
Sets whether vertical synchronization (VSync) is enabled.
virtual uint32_t GetHeight() const =0
Retrieves the height of the window.
Event for registering window resize.
Definition ApplicationEvent.h:16
unsigned int GetHeight() const
Get the new height of the window.
Definition ApplicationEvent.h:29
unsigned int m_Height
Definition ApplicationEvent.h:43
WindowResizeEvent(unsigned int width, unsigned int height)
Construct a WindowResizeEvent with the specified width and height.
Definition ApplicationEvent.h:23
std::string ToString() const override
Convert the event to a string representation.
Definition ApplicationEvent.h:32
unsigned int GetWidth() const
Get the new width of the window.
Definition ApplicationEvent.h:27
unsigned int m_Width
Definition ApplicationEvent.h:43
static glm::vec4 Blue()
Returns a vec4 representing the color blue.
Definition Color.h:31
static glm::vec4 Pink()
Returns a vec4 representing the color pink.
Definition Color.h:42
static glm::vec4 Black()
Returns a vec4 representing the color black.
Definition Color.h:18
static glm::vec4 Indigo()
Returns a vec4 representing the color indigo.
Definition Color.h:33
static glm::vec4 White()
Returns a vec4 representing the color white.
Definition Color.h:16
static glm::vec4 Yellow()
Returns a vec4 representing the color yellow.
Definition Color.h:27
static glm::vec4 Magenta()
Returns a vec4 representing the color magenta.
Definition Color.h:40
static glm::vec4 Cyan()
Returns a vec4 representing the color cyan.
Definition Color.h:38
static glm::vec4 Brown()
Returns a vec4 representing the color brown.
Definition Color.h:44
static glm::vec4 Green()
Returns a vec4 representing the color green.
Definition Color.h:29
static glm::vec4 Transparent()
Returns a vec4 representing a fully transparent color.
Definition Color.h:46
static glm::vec4 Orange()
Returns a vec4 representing the color orange.
Definition Color.h:25
static glm::vec4 StripAlpha(const glm::vec4 &color)
Strips the alpha component from the given color, setting it to 1.0 (fully opaque).
Definition Color.h:49
static glm::vec4 SetAlpha(const glm::vec4 &color, float alpha=0.0f)
Sets the alpha component of the given color to the specified value.
Definition Color.h:51
static glm::vec4 Purple()
Returns a vec4 representing the color purple.
Definition Color.h:35
static glm::vec4 Red()
Returns a vec4 representing the color red.
Definition Color.h:23
static glm::vec4 Gray()
Returns a vec4 representing the color gray.
Definition Color.h:20
@ Up
Definition KeyCodes.h:83
@ D6
Definition KeyCodes.h:30
@ Y
Definition KeyCodes.h:62
@ RightAlt
Definition KeyCodes.h:145
@ PageUp
Definition KeyCodes.h:84
@ P
Definition KeyCodes.h:53
@ D1
Definition KeyCodes.h:25
@ F15
Definition KeyCodes.h:107
@ Apostrophe
Definition KeyCodes.h:18
@ Z
Definition KeyCodes.h:63
@ Right
Definition KeyCodes.h:80
@ L
Definition KeyCodes.h:49
@ LeftAlt
Definition KeyCodes.h:141
@ D4
Definition KeyCodes.h:28
@ Space
Definition KeyCodes.h:17
@ KP_ENTER
Definition KeyCodes.h:135
@ F5
Definition KeyCodes.h:97
@ Period
Definition KeyCodes.h:21
@ KP_2
Definition KeyCodes.h:122
@ KP_ADD
Definition KeyCodes.h:134
@ F6
Definition KeyCodes.h:98
@ RightShift
Definition KeyCodes.h:143
@ KP_7
Definition KeyCodes.h:127
@ Down
Definition KeyCodes.h:82
@ I
Definition KeyCodes.h:46
@ F9
Definition KeyCodes.h:101
@ Minus
Definition KeyCodes.h:20
@ D5
Definition KeyCodes.h:29
@ F11
Definition KeyCodes.h:103
@ KP_MULTIPLY
Definition KeyCodes.h:132
@ Escape
Definition KeyCodes.h:74
@ Pause
Definition KeyCodes.h:92
@ F
Definition KeyCodes.h:43
@ KP_1
Definition KeyCodes.h:121
@ Backspace
Definition KeyCodes.h:77
@ F23
Definition KeyCodes.h:115
@ KP_DECIMAL
Definition KeyCodes.h:130
@ KP_8
Definition KeyCodes.h:128
@ B
Definition KeyCodes.h:39
@ F13
Definition KeyCodes.h:105
@ KP_EQUAL
Definition KeyCodes.h:136
@ K
Definition KeyCodes.h:48
@ Slash
Definition KeyCodes.h:22
@ RightSuper
Definition KeyCodes.h:146
@ RightControl
Definition KeyCodes.h:144
@ Q
Definition KeyCodes.h:54
@ F17
Definition KeyCodes.h:109
@ F7
Definition KeyCodes.h:99
@ KP_3
Definition KeyCodes.h:123
@ C
Definition KeyCodes.h:40
@ V
Definition KeyCodes.h:59
@ KP_9
Definition KeyCodes.h:129
@ D7
Definition KeyCodes.h:31
@ Home
Definition KeyCodes.h:86
@ F19
Definition KeyCodes.h:111
@ ScrollLock
Definition KeyCodes.h:89
@ KP_6
Definition KeyCodes.h:126
@ F18
Definition KeyCodes.h:110
@ KP_4
Definition KeyCodes.h:124
@ F25
Definition KeyCodes.h:117
@ D0
Definition KeyCodes.h:24
@ D3
Definition KeyCodes.h:27
@ O
Definition KeyCodes.h:52
@ F16
Definition KeyCodes.h:108
@ D8
Definition KeyCodes.h:32
@ KP_0
Definition KeyCodes.h:120
@ A
Definition KeyCodes.h:38
@ F14
Definition KeyCodes.h:106
@ J
Definition KeyCodes.h:47
@ D
Definition KeyCodes.h:41
@ F20
Definition KeyCodes.h:112
@ End
Definition KeyCodes.h:87
@ H
Definition KeyCodes.h:45
@ LeftShift
Definition KeyCodes.h:139
@ F3
Definition KeyCodes.h:95
@ LeftSuper
Definition KeyCodes.h:142
@ PrintScreen
Definition KeyCodes.h:91
@ LeftControl
Definition KeyCodes.h:140
@ Insert
Definition KeyCodes.h:78
@ F21
Definition KeyCodes.h:113
@ W
Definition KeyCodes.h:60
@ G
Definition KeyCodes.h:44
@ LeftBracket
Definition KeyCodes.h:65
@ F12
Definition KeyCodes.h:104
@ PageDown
Definition KeyCodes.h:85
@ Enter
Definition KeyCodes.h:75
@ Backslash
Definition KeyCodes.h:66
@ E
Definition KeyCodes.h:42
@ F1
Definition KeyCodes.h:93
@ T
Definition KeyCodes.h:57
@ F10
Definition KeyCodes.h:102
@ D9
Definition KeyCodes.h:33
@ F8
Definition KeyCodes.h:100
@ X
Definition KeyCodes.h:61
@ CapsLock
Definition KeyCodes.h:88
@ World2
Definition KeyCodes.h:71
@ U
Definition KeyCodes.h:58
@ Comma
Definition KeyCodes.h:19
@ F4
Definition KeyCodes.h:96
@ Equal
Definition KeyCodes.h:36
@ M
Definition KeyCodes.h:50
@ RightBracket
Definition KeyCodes.h:67
@ KP_DIVIDE
Definition KeyCodes.h:131
@ F22
Definition KeyCodes.h:114
@ R
Definition KeyCodes.h:55
@ Tab
Definition KeyCodes.h:76
@ GraveAccent
Definition KeyCodes.h:68
@ World1
Definition KeyCodes.h:70
@ F24
Definition KeyCodes.h:116
@ Delete
Definition KeyCodes.h:79
@ F2
Definition KeyCodes.h:94
@ D2
Definition KeyCodes.h:26
@ KP_5
Definition KeyCodes.h:125
@ Semicolon
Definition KeyCodes.h:35
@ Menu
Definition KeyCodes.h:147
@ N
Definition KeyCodes.h:51
@ KP_SUBTRACT
Definition KeyCodes.h:133
@ Left
Definition KeyCodes.h:81
@ NumLock
Definition KeyCodes.h:90
@ S
Definition KeyCodes.h:56
Definition Math.cpp:7
bool DecomposeTransform(const glm::mat4 &transform, glm::vec3 &translation, glm::vec3 &rotation, glm::vec3 &scale)
Decomposes a transformation matrix into its translation, rotation, and scale components.
Definition Math.cpp:10
@ Button4
Definition MouseButtonCodes.h:20
@ Button3
Definition MouseButtonCodes.h:19
@ ButtonMiddle
Definition MouseButtonCodes.h:28
@ Button6
Definition MouseButtonCodes.h:22
@ ButtonRight
Definition MouseButtonCodes.h:27
@ Button7
Definition MouseButtonCodes.h:23
@ ButtonLeft
Definition MouseButtonCodes.h:26
@ Button2
Definition MouseButtonCodes.h:18
@ ButtonLast
Definition MouseButtonCodes.h:25
@ Button5
Definition MouseButtonCodes.h:21
@ Button0
Definition MouseButtonCodes.h:16
@ Button1
Definition MouseButtonCodes.h:17
Definition Random.h:14
glm::vec3 Float3()
Definition Random.h:121
std::string HexString(size_t length)
Definition Random.h:57
glm::vec3 RangeF3(const glm::vec2 &range1, const glm::vec2 &range2, const glm::vec2 &range3)
Definition Random.h:136
float RangeF1_Inclusive(float min, float max)
Definition Random.h:92
glm::vec2 RangeF2(const glm::vec2 &minRange, const glm::vec2 &maxRange)
Definition Random.h:115
std::mt19937 & GetRNG()
Definition Random.h:16
bool Bool1(float trueChance)
Definition Random.h:31
glm::vec4 Float4()
Definition Random.h:141
glm::vec2 RangeF2(float min, float max)
Definition Random.h:105
float Float1()
Definition Random.h:76
void Seed(uint32_t seed)
Definition Random.h:21
float RangeF1(float min, float max)
Definition Random.h:84
glm::vec4 RangeF4(float min, float max)
Definition Random.h:146
std::string UUID()
Definition Random.h:70
glm::vec2 RangeF2(float min1, float max1, float min2, float max2)
Definition Random.h:110
unsigned char Char()
Definition Random.h:37
glm::vec3 RangeF3(float min, float max)
Definition Random.h:126
glm::vec2 Float2()
Definition Random.h:100
glm::vec3 RangeF3(float min1, float max1, float min2, float max2, float min3, float max3)
Definition Random.h:131
std::string String(size_t length)
Definition Random.h:43
uint32_t UInt1(uint32_t max)
Definition Random.h:25
TEMPORARY.
Definition WindowsInput.cpp:7
std::string WorkingDirectory
Definition Application.h:22
WindowMode Mode
Definition Application.h:26
float LifetimeVariation
Definition ParticleSystem.h:21
std::string format_as(const Event &e)
Format an event as a string.
Definition Event.h:104
constexpr Ref< T > CreateRef(Args &&... args)
Creates a Ref (shared_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:72
uint32_t Width
Definition Application.h:24
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:52
float LifeTime
Definition ParticleSystem.h:20
Application * CreateApplication()
Definition VesperEditorApp.cpp:23
bool EnableImGui
Definition Application.h:27
uint8_t MouseCode
Alias for mouse button code type.
Definition MouseButtonCodes.h:6
glm::vec4 ColorEnd
Definition ParticleSystem.h:14
uint32_t Samples
Definition Framebuffer.h:12
WindowMode
WIP.
Definition Window.h:16
@ Fullscreen
Definition Window.h:18
@ Borderless
Definition Window.h:19
@ Windowed
Definition Window.h:17
float SizeVariation
Definition ParticleSystem.h:17
float RotationVariation
Definition ParticleSystem.h:19
uint32_t Height
Definition Framebuffer.h:10
float SizeBegin
Definition ParticleSystem.h:15
bool SwapChainTarget
Definition Framebuffer.h:14
uint32_t Width
Definition Framebuffer.h:10
bool EnableVSync
Definition Application.h:28
float SizeEnd
Definition ParticleSystem.h:16
uint16_t KeyCode
Alias for keyboard key code type.
Definition KeyCodes.h:6
std::string ApplicationName
Definition Application.h:21
static void DisplayVesperInfo_ImGui()
Definition VesperImGui.h:7
static uint32_t ShaderDataTypeSize(ShaderDataType type)
Returns the size in bytes of the given ShaderDataType.
Definition Buffer.h:19
glm::vec4 ColorBegin
Definition ParticleSystem.h:13
glm::vec3 Position
Definition ParticleSystem.h:10
uint32_t Height
Definition Application.h:25
EventCategory
Enumeration of event categories.
Definition Event.h:24
@ EventCategoryMouseButton
Definition Event.h:30
@ EventCategoryMouse
Definition Event.h:29
@ EventCategoryApplication
Definition Event.h:26
@ None
Definition Event.h:25
@ EventCategoryInput
Definition Event.h:27
@ EventCategoryKeyboard
Definition Event.h:28
EventType
Enumeration of event types.
Definition Event.h:14
@ WindowLostFocus
Definition Event.h:16
@ WindowFocus
Definition Event.h:16
@ KeyReleased
Definition Event.h:18
@ AppRender
Definition Event.h:17
@ MouseScrolled
Definition Event.h:19
@ AppTick
Definition Event.h:17
@ None
Definition Event.h:15
@ MouseButtonPressed
Definition Event.h:19
@ MouseButtonReleased
Definition Event.h:19
@ KeyTyped
Definition Event.h:18
@ WindowResize
Definition Event.h:16
@ WindowMoved
Definition Event.h:16
@ AppUpdate
Definition Event.h:17
@ KeyPressed
Definition Event.h:18
@ MouseMoved
Definition Event.h:19
@ WindowClose
Definition Event.h:16
glm::vec3 VelocityVariation
Definition ParticleSystem.h:12
glm::vec3 Velocity
Definition ParticleSystem.h:11
ShaderDataType
The different data types that can be used in shaders.
Definition Buffer.h:6
@ Int
Definition Buffer.h:10
@ Int4
Definition Buffer.h:10
@ Float
Definition Buffer.h:8
@ Mat3
Definition Buffer.h:9
@ Float4
Definition Buffer.h:8
@ Int2
Definition Buffer.h:10
@ Int3
Definition Buffer.h:10
@ Float2
Definition Buffer.h:8
@ None
Definition Buffer.h:7
@ Mat4
Definition Buffer.h:9
@ Float3
Definition Buffer.h:8
@ Bool
Definition Buffer.h:11
float Rotation
Definition ParticleSystem.h:18
WIP.
Definition Application.h:20
Specification for creating a Framebuffer.
Definition Framebuffer.h:9
Definition ParticleSystem.h:9
Represents a single element in a buffer layout.
Definition Buffer.h:39
BufferElement()
Definition Buffer.h:51
ShaderDataType Type
The data type of the buffer element.
Definition Buffer.h:43
std::string Name
The name of the buffer element.
Definition Buffer.h:41
BufferElement(ShaderDataType type, const std::string &name, bool normalized=false)
Constructs a BufferElement with the given type, name, and normalization flag.
Definition Buffer.h:57
uint32_t GetComponentCount() const
Returns the number of components in the buffer element based on its ShaderDataType.
Definition Buffer.h:63
uint32_t Size
The size in bytes of the buffer element.
Definition Buffer.h:45
uint32_t Offset
The offset in bytes of the buffer element from the start of the buffer.
Definition Buffer.h:47
bool Normalized
Whether the buffer element is normalized.
Definition Buffer.h:49
Definition OrthographicCameraController.h:15
float Right
Definition OrthographicCameraController.h:16
float GetHeight() const
Definition OrthographicCameraController.h:20
float Left
Definition OrthographicCameraController.h:16
float GetWidth() const
Definition OrthographicCameraController.h:19
float Bottom
Definition OrthographicCameraController.h:17
float Top
Definition OrthographicCameraController.h:17
2D Renderer Statistics
Definition Renderer2D.h:205
uint32_t DrawCalls
The number of draw calls being made.
Definition Renderer2D.h:207
uint32_t GetTotalVertexCount()
Calculates the total number of vertices drawn.
Definition Renderer2D.h:211
uint32_t GetTotalIndexCount()
Calculates the total number of indices drawn.
Definition Renderer2D.h:213
uint32_t QuadCount
The number of quads being drawn.
Definition Renderer2D.h:209
Holds the data for window configuration.
Definition Window.h:23
uint32_t Height
Definition Window.h:26
uint32_t Width
Definition Window.h:25
std::string Title
Definition Window.h:24