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
Asserts.h
Go to the documentation of this file.
1#pragma once
2
3/// @file Asserts.h
4/// @author Damon S. Green II
5/// @brief Provides assertion macros for debugging and error handling.
6
7
8/// ASSERT MACROS
9#ifdef VZ_DEBUG
10#define VZ_ENABLE_ASSERTS
11#endif
12
13#ifdef VZ_ENABLE_ASSERTS
14/// @brief Asserts that the given condition is true. If not, logs an error message and triggers a breakpoint.
15#define VZ_ASSERT(x, ...) { if(!(x)) { VZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } }
16/// @brief Asserts that the given condition is true in core code. If not, logs an error message and triggers a breakpoint.
17#define VZ_CORE_ASSERT(x, ...) { if(!(x)) { VZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } }
18#else
19#define VZ_ASSERT(x, ...)
20#define VZ_CORE_ASSERT(x, ...)
21#endif
#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
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_FUNCTION()
Definition Instrumentor.h:240
#define VZ_PROFILE_SCOPE(name)
Definition Instrumentor.h:239
#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
The core application class that manages the main loop, window, layers, and event handling.
Definition Application.h:35
static Application & Get()
Retrieves the singleton instance of the Application.
Definition Application.h:67
ImGuiLayer * GetImGuiLayer()
Retrieves the ImGui layer.
Definition Application.h:64
void Close()
Closes the application.
Definition Application.cpp:55
Definition EditorCamera.h:13
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
Stack-based templated event dispatcher.
Definition Event.h:68
EventDispatcher(Event &event)
Construct an EventDispatcher for a specific event.
Definition Event.h:78
Abstract base class for all events.
Definition Event.h:37
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
virtual void SetBlockEvents(bool block)
Definition ImGuiLayer.h:26
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 bool IsKeyPressed(int keycode)
Checks if the specified key is currently pressed.
Definition WindowsInput.cpp:9
int GetKeyCode() const
Get the key code associated with the event.
Definition KeyEvent.h:20
Event for registering key press.
Definition KeyEvent.h:37
int GetRepeatCount() const
Get the repeat count of the key press event.
Definition KeyEvent.h:48
Represents a reusable application layer that receives lifecycle callbacks (attach,...
Definition Layer.h:17
Definition OrthographicCameraController.h:26
Definition ParticleSystem.h:25
A static class that provides an interface for issuing rendering commands.
Definition RenderCommand.h:10
static void Clear()
Clears the rendering buffers.
Definition RenderCommand.h:32
A 2D renderer for drawing quads and sprites.
Definition Renderer2D.h:17
static void ResetStats()
Resets the rendering statistics.
Definition Renderer2D.cpp:497
static void EndScene()
Ends the current scene.
Definition Renderer2D.cpp:160
static Statistics GetStats()
Retrieves the current rendering statistics.
Definition Renderer2D.cpp:502
Definition SceneSerializer.h:7
bool Deserialize(const std::string &filepath)
Definition SceneSerializer.cpp:206
void Serialize(const std::string &filepath)
Definition SceneSerializer.cpp:179
Represents a time step in seconds.
Definition Timestep.h:12
@ RightShift
Definition KeyCodes.h:143
@ RightControl
Definition KeyCodes.h:144
@ Q
Definition KeyCodes.h:54
@ O
Definition KeyCodes.h:52
@ LeftShift
Definition KeyCodes.h:139
@ LeftControl
Definition KeyCodes.h:140
@ N
Definition KeyCodes.h:51
@ 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
@ ButtonLeft
Definition MouseButtonCodes.h:26
TEMPORARY.
Definition WindowsInput.cpp:7
uint32_t Height
Definition Framebuffer.h:10
uint32_t Width
Definition Framebuffer.h:10
static void DisplayVesperInfo_ImGui()
Definition VesperImGui.h:7
Specification for creating a Framebuffer.
Definition Framebuffer.h:9
Definition ParticleSystem.h:9