20#define SDL_MAIN_HANDLED
29#include "components/Environment.hpp"
33#include "components/DebugConsole.hpp"
35#include "VEX/VEX_export.h"
89 void run(std::function<
void()> onUpdateLoop =
nullptr);
158 std::shared_ptr<VexUI> createVexUI();
170 virtual void setFullscreen(
bool enabled,
bool exclusive =
false);
180 void prepareScenesForHotReload();
186 virtual void processEvent(
const SDL_Event& event,
float deltaTime);
189 virtual void beginGame();
195 virtual void update(
float deltaTime);
205 virtual void render();
209 log(
"Editor use only");
213 void quit(){ m_running =
false; }
222 void setFrameLimit(
int fps);
223 int getFrameLimit()
const {
return m_targetFps; }
226 void setVSync(
bool enabled);
229 bool getVSync()
const;
242 std::shared_ptr<Window> m_window;
243 std::shared_ptr<VirtualFileSystem> m_vfs;
244 std::shared_ptr<AudioSystem> m_audioSystem;
246 std::unique_ptr<Interface> m_interface;
247 std::unique_ptr<ResolutionManager> m_resolutionManager;
248 std::unique_ptr<ImGUIWrapper> m_imgui;
249 std::unique_ptr<InputSystem> m_inputSystem;
250 std::unique_ptr<PhysicsSystem> m_physicsSystem;
251 std::unique_ptr<SceneManager> m_sceneManager;
255 bool m_running =
true;
256 bool m_paused =
false;
257 bool m_internally_paused =
false;
258 bool m_renderPhysicsDebug =
false;
262 bool m_vsyncEnabled =
false;
264 float m_deltaTime = 0.016f;
267 bool m_isWayland =
false;
271 std::vector<std::string> lastLoadedScenes;
Audio system for managing audio sources, playback, and 3D spatialization.
Contains basic components like transform, camera, name components..
Main header for the Entity Component System (ECS) framework.
This file defines struct GameInfo.
This file defines ImGUIWrapper class.
This file defines PhysicsSystem class.
This file defines ResolutionManager class and ResolutionMode struct.
This file defines vex ui class, very basic ui system.
Class for interaction with engine systems.
std::shared_ptr< VirtualFileSystem > getFileSystem()
Returns std::shared_ptr of VirtualFileSystem.
ResolutionManager * getResolutionManager() const
returns a pointer to the resolution manager.
std::vector< std::string > getLastLoadedScenes()
Function to get the last loaded scenes.
void setInputMode(InputMode mode)
Function allowing for changing input mode at runtime.
bool isPaused() const
Function returning the current state of the game.
void quit()
Simply sets m_running to false, Effectivelly soft shuting down the engine.
static int GetVersionMinor()
Returns the minor version of the engine.
static const char * GetVersionString()
Returns the version string of the engine.
std::shared_ptr< AudioSystem > getAudioSystem() const
Returns the audio system.
InputMode getInputMode() const
Returns the current input mode.
virtual bool IsEditor()
Returns true if the engine is running in editor mode.
void setPaused(bool paused)
Internal function for handling pausing and resuming the game.
static const char * GetBuildHash()
returns engine hash generated during build process.
int GetCurrentFrame()
Returns current frame number.
ResolutionMode getResolutionMode() const
Returns the current resolution mode.
PhysicsSystem * getPhysicsSystem()
Returns pointer to PhysicsSystem.
static int GetVersionPatch()
Returns the patch version of the engine.
virtual void refreshForObject()
Internal virtual function for editor.
Engine(const char *title, int width, int height, GameInfo gInfo)
Constructor for the Engine class.
void setRenderPhysicsDebug(bool value)
Function to enable/disable rendering collision shapes.
float getDeltaTime() const
Returns the time since last frame.
vex::Entity getCamera()
Function returning the entity of the camera.
vex::Registry & getRegistry()
Returns a reference to vex::Registry.
static int GetVersionMajor()
Returns the major version of the engine.
Interface Class for vulkan backend.
Class representing a physics system.
Central registry for managing entities and their components in the ECS system.
Class responsible for managing resolution settings, calculating render resolution based on selected m...
SceneManager class implements scene management functionality like loading and unloading scenes,...
Provides iteration over entities that have all specified component types.
void each(Func func)
Iterates over all entities with the specified component types.
This class provides abstraction of file system needed for loading packed and unpacked assets.
This class esentially abstracts SDL_Window.
uint32_t Entity
Type alias representing a unique entity identifier in the ECS system.
ResolutionMode
Enumeration representing different resolution modes.
InputMode
Enum representing different input modes.
void VEX_EXPORT log(const char *fmt,...)
Logs a formatted message.
constexpr Entity NULL_ENTITY
Special entity value indicating an invalid or null entity.
Struct that contains camera properties. Used by build in CameraObject, but needed for any custom one ...
this struct contains information about the game. like project name and version.
This struct is used to hold all environment settings. eg. shading details or lighting setup.