Specialized Engine class for the initial project selection screen. More...
#include <ProjectSelector.hpp>
Public Member Functions | |
| ProjectSelector (const char *title) | |
| Constructs the ProjectSelector window. | |
| void | render () override |
| Overrides the base render function to draw the project selection UI. | |
| std::string | getSelectedProject () const |
| Gets the path of the project selected by the user. | |
| Public Member Functions inherited from vex::Engine | |
| Engine (const char *title, int width, int height, GameInfo gInfo) | |
| Constructor for the Engine class. | |
| virtual bool | IsEditor () |
| Returns true if the engine is running in editor mode. | |
| void | run (std::function< void()> onUpdateLoop=nullptr) |
| Starts and runs the main game loop. | |
| vex::Entity | getCamera () |
| Function returning the entity of the camera. | |
| void | setResolutionMode (ResolutionMode mode) |
| Sets the resolution mode and updates the resolution manager. | |
| void | setPaused (bool paused) |
| Internal function for handling pausing and resuming the game. | |
| bool | isPaused () const |
| Function returning the current state of the game. | |
| ResolutionMode | getResolutionMode () const |
| Returns the current resolution mode. | |
| ResolutionManager * | getResolutionManager () const |
| returns a pointer to the resolution manager. | |
| void | setInputMode (InputMode mode) |
| Function allowing for changing input mode at runtime. | |
| InputMode | getInputMode () const |
| Returns the current input mode. | |
| void | setEnvironmentSettings (environment settings) |
| Applies new global environment settings (lighting, shading) to the interface. | |
| environment | getEnvironmentSettings () |
| Returns the current environment settings. | |
| Interface * | getInterface () |
| Returns Interface, used internally. | |
| std::shared_ptr< VirtualFileSystem > | getFileSystem () |
| Returns std::shared_ptr of VirtualFileSystem. | |
| vex::Registry & | getRegistry () |
| Returns a reference to vex::Registry. | |
| PhysicsSystem * | getPhysicsSystem () |
| Returns pointer to PhysicsSystem. | |
| SceneManager * | getSceneManager () |
| Returns pointer to SceneManager. | |
| std::shared_ptr< VexUI > | createVexUI () |
| Creates and returns a shared pointer to a VexUI instance. | |
| int | GetCurrentFrame () |
| Returns current frame number. | |
| void | setRenderPhysicsDebug (bool value) |
| Function to enable/disable rendering collision shapes. | |
| virtual void | setFullscreen (bool enabled, bool exclusive=false) |
| Function to enable/disable fullscreen mode. with optional exclusive parameter. | |
| bool | isFullscreen () |
| Function to check if fullscreen mode is enabled. | |
| std::vector< std::string > | getLastLoadedScenes () |
| Function to get the last loaded scenes. | |
| void | prepareScenesForHotReload () |
| Prepares the engine for a hot-reload event. | |
| virtual void | processEvent (const SDL_Event &event, float deltaTime) |
| Internal virtual function for handling window/keyboard events. | |
| virtual void | beginGame () |
| Internal virtual function for handling stuff right at the beginning of the game but after initialization of the engine. | |
| virtual void | update (float deltaTime) |
| Internal function for handling updates; called every frame before rendering. | |
| virtual void | refreshForObject () |
| Internal virtual function for editor. | |
| void | quit () |
| Simply sets m_running to false, Effectivelly soft shuting down the engine. | |
| void | WaitForGpu () |
| Waits for the GPU to finish all pending operations. | |
| void | setFrameLimit (int fps) |
| Sets the target frame rate limit. | |
| int | getFrameLimit () const |
| void | setVSync (bool enabled) |
| Toggles VSync (Vertical Synchronization). | |
| bool | getVSync () const |
| Returns the current state of VSync. | |
| float | getDeltaTime () const |
| Returns the time since last frame. | |
| std::shared_ptr< AudioSystem > | getAudioSystem () const |
| Returns the audio system. | |
Private Member Functions | |
| void | drawSelectorLayout (const SceneRenderData &data) |
| Internal helper to draw the ImGUI layout for the project selector. | |
| void | loadKnownProjects () |
| Loads the list of recently known projects from the configuration file. | |
| void | saveKnownProjects () |
| Saves the current list of known projects to the configuration file. | |
| void | scanAndAddProject (const std::string &path) |
| Scans a directory path for a valid VEX project file and adds it to the list. | |
| void | selectProject (const std::string &projectPath) |
| Sets the path of the project that the user selected and triggers the closure of the selector. | |
| void | drawCreatorModal () |
| Draws the modal for creating a new project. | |
| void | drawAddExistingModal () |
| Draws the modal for adding an existing project. | |
| void | drawMoveProjectModal () |
| Draws the modal for moving an existing project. | |
| void | createNewProject () |
| Creates a new project with the given name and path. | |
| void | removeProject (int index) |
| Removes a project from the list. | |
| void | moveProject (int index, const std::string &newParentDir) |
| Moves a project to a new parent directory. | |
| std::filesystem::path | getUserDocumentsDir () |
| Gets the path to the user's documents directory. | |
Private Attributes | |
| char | m_newProjName [64] = "NewVexProject" |
| char | m_newProjParentDir [512] = "" |
| char | m_addExistingBuffer [512] = "" |
| char | m_moveProjDestBuffer [512] = "" |
| int | m_contextMenuTargetIndex = -1 |
| std::vector< ProjectMetadata > | m_projects |
| std::string | m_configPath = "recent_projects.json" |
| char | m_inputBuffer [256] = "" |
| std::string | m_selectedProjectPath = "" |
| bool | shouldClose = false |
| uint8_t | closeDelay = 5 |
| bool | m_showCreatorModal = false |
| bool | m_showAddExistingModal = false |
| bool | m_showMoveModal = false |
Additional Inherited Members | |
| Static Public Member Functions inherited from vex::Engine | |
| static const char * | GetBuildHash () |
| returns engine hash generated during build process. | |
| static int | GetVersionMajor () |
| Returns the major version of the engine. | |
| static int | GetVersionMinor () |
| Returns the minor version of the engine. | |
| static int | GetVersionPatch () |
| Returns the patch version of the engine. | |
| static const char * | GetVersionString () |
| Returns the version string of the engine. | |
| Protected Member Functions inherited from vex::Engine | |
| Engine (SkipInit) | |
| Alternative constructor for editor to skip default init code. | |
| Protected Attributes inherited from vex::Engine | |
| std::shared_ptr< Window > | m_window |
| std::shared_ptr< VirtualFileSystem > | m_vfs |
| std::shared_ptr< AudioSystem > | m_audioSystem |
| std::unique_ptr< Interface > | m_interface |
| std::unique_ptr< ResolutionManager > | m_resolutionManager |
| std::unique_ptr< ImGUIWrapper > | m_imgui |
| std::unique_ptr< InputSystem > | m_inputSystem |
| std::unique_ptr< PhysicsSystem > | m_physicsSystem |
| std::unique_ptr< SceneManager > | m_sceneManager |
| vex::Registry | m_registry |
| bool | m_running = true |
| bool | m_paused = false |
| bool | m_internally_paused = false |
| bool | m_renderPhysicsDebug = false |
| int | m_frame = 0 |
| int | m_targetFps = 0 |
| bool | m_vsyncEnabled = false |
| float | m_deltaTime = 0.016f |
| GameInfo | m_gameInfo |
| std::vector< std::string > | lastLoadedScenes |
Specialized Engine class for the initial project selection screen.
Definition at line 34 of file ProjectSelector.hpp.
| vex::ProjectSelector::ProjectSelector | ( | const char * | title | ) |
Constructs the ProjectSelector window.
| const | char* title - The title of the window. |
Definition at line 21 of file ProjectSelector.cpp.
|
private |
Creates a new project with the given name and path.
Definition at line 380 of file ProjectSelector.cpp.
|
private |
Draws the modal for adding an existing project.
Definition at line 168 of file ProjectSelector.cpp.
|
private |
Draws the modal for creating a new project.
Definition at line 339 of file ProjectSelector.cpp.
|
private |
Draws the modal for moving an existing project.
Definition at line 198 of file ProjectSelector.cpp.
|
private |
Internal helper to draw the ImGUI layout for the project selector.
| const | SceneRenderData& data - Data required for scene rendering (unused here). |
Definition at line 79 of file ProjectSelector.cpp.
|
inline |
Gets the path of the project selected by the user.
Definition at line 48 of file ProjectSelector.hpp.
|
private |
Gets the path to the user's documents directory.
Definition at line 429 of file ProjectSelector.cpp.
|
private |
Loads the list of recently known projects from the configuration file.
Definition at line 275 of file ProjectSelector.cpp.
|
private |
Moves a project to a new parent directory.
Definition at line 243 of file ProjectSelector.cpp.
|
private |
Removes a project from the list.
Definition at line 235 of file ProjectSelector.cpp.
|
overridevirtual |
Overrides the base render function to draw the project selection UI.
Reimplemented from vex::Engine.
Definition at line 35 of file ProjectSelector.cpp.
|
private |
Saves the current list of known projects to the configuration file.
Definition at line 291 of file ProjectSelector.cpp.
|
private |
Scans a directory path for a valid VEX project file and adds it to the list.
| const | std::string& path - The directory path to scan. |
Definition at line 304 of file ProjectSelector.cpp.
|
private |
Sets the path of the project that the user selected and triggers the closure of the selector.
| const | std::string& projectPath - The path of the project selected. |
Definition at line 333 of file ProjectSelector.cpp.
|
private |
Definition at line 125 of file ProjectSelector.hpp.
|
private |
Definition at line 113 of file ProjectSelector.hpp.
|
private |
Definition at line 119 of file ProjectSelector.hpp.
|
private |
Definition at line 116 of file ProjectSelector.hpp.
|
private |
Definition at line 120 of file ProjectSelector.hpp.
|
private |
Definition at line 114 of file ProjectSelector.hpp.
|
private |
Definition at line 110 of file ProjectSelector.hpp.
|
private |
Definition at line 111 of file ProjectSelector.hpp.
|
private |
Definition at line 118 of file ProjectSelector.hpp.
|
private |
Definition at line 122 of file ProjectSelector.hpp.
|
private |
Definition at line 127 of file ProjectSelector.hpp.
|
private |
Definition at line 126 of file ProjectSelector.hpp.
|
private |
Definition at line 128 of file ProjectSelector.hpp.
|
private |
Definition at line 124 of file ProjectSelector.hpp.