VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
vex::DialogWindow Class Reference

A specialized Engine class for creating and managing modal dialog windows. More...

#include <DialogWindow.hpp>

Inheritance diagram for vex::DialogWindow:
vex::Engine

Public Member Functions

 DialogWindow (const char *title, GameInfo gInfo)
 Constructs a DialogWindow.
void render () override
 Overrides the Engine's render function to draw the dialog content.
void close ()
 Cleans up and shuts down the core engine components used by the dialog.
void stop ()
 Sets the internal running flag to false, effectivelly stopping the dialog's run loop.
bool isRunning () const
 Checks if the dialog window is currently running.
void setDialogContent (const std::string &content)
 Sets the content string to be displayed in the dialog.
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.
ResolutionManagergetResolutionManager () 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.
InterfacegetInterface ()
 Returns Interface, used internally.
std::shared_ptr< VirtualFileSystemgetFileSystem ()
 Returns std::shared_ptr of VirtualFileSystem.
vex::RegistrygetRegistry ()
 Returns a reference to vex::Registry.
PhysicsSystemgetPhysicsSystem ()
 Returns pointer to PhysicsSystem.
SceneManagergetSceneManager ()
 Returns pointer to SceneManager.
std::shared_ptr< VexUIcreateVexUI ()
 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< AudioSystemgetAudioSystem () const
 Returns the audio system.

Private Member Functions

void drawDialogWindowLayout (const SceneRenderData &data, glm::uvec2 &outNewResolution)
 Internal helper to draw the ImGUI layout for the dialog window.

Private Attributes

std::string m_dialogContent = ""

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< Windowm_window
std::shared_ptr< VirtualFileSystemm_vfs
std::shared_ptr< AudioSystemm_audioSystem
std::unique_ptr< Interfacem_interface
std::unique_ptr< ResolutionManagerm_resolutionManager
std::unique_ptr< ImGUIWrapperm_imgui
std::unique_ptr< InputSystemm_inputSystem
std::unique_ptr< PhysicsSystemm_physicsSystem
std::unique_ptr< SceneManagerm_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

Detailed Description

A specialized Engine class for creating and managing modal dialog windows.

Definition at line 17 of file DialogWindow.hpp.

Constructor & Destructor Documentation

◆ DialogWindow()

vex::DialogWindow::DialogWindow ( const char * title,
GameInfo gInfo )

Constructs a DialogWindow.

Parameters
constchar* title - The title of the dialog window.
GameInfogInfo - The GameInfo object.

Definition at line 19 of file DialogWindow.cpp.

◆ ~DialogWindow()

vex::DialogWindow::~DialogWindow ( )

Definition at line 22 of file DialogWindow.cpp.

Member Function Documentation

◆ close()

void vex::DialogWindow::close ( )
inline

Cleans up and shuts down the core engine components used by the dialog.

Definition at line 29 of file DialogWindow.hpp.

◆ drawDialogWindowLayout()

void vex::DialogWindow::drawDialogWindowLayout ( const SceneRenderData & data,
glm::uvec2 & outNewResolution )
private

Internal helper to draw the ImGUI layout for the dialog window.

Parameters
constSceneRenderData& data - Data required for scene rendering (unused in basic dialog).
glm::uvec2&outNewResolution - Output parameter for new resolution (unused in basic dialog).

Definition at line 58 of file DialogWindow.cpp.

◆ isRunning()

bool vex::DialogWindow::isRunning ( ) const
inline

Checks if the dialog window is currently running.

Returns
bool - True if running, false otherwise.

Definition at line 44 of file DialogWindow.hpp.

◆ render()

void vex::DialogWindow::render ( )
overridevirtual

Overrides the Engine's render function to draw the dialog content.

Reimplemented from vex::Engine.

Definition at line 26 of file DialogWindow.cpp.

◆ setDialogContent()

void vex::DialogWindow::setDialogContent ( const std::string & content)
inline

Sets the content string to be displayed in the dialog.

Parameters
conststd::string& content - The message content.

Definition at line 50 of file DialogWindow.hpp.

◆ stop()

void vex::DialogWindow::stop ( )
inline

Sets the internal running flag to false, effectivelly stopping the dialog's run loop.

Definition at line 38 of file DialogWindow.hpp.

Member Data Documentation

◆ m_dialogContent

std::string vex::DialogWindow::m_dialogContent = ""
private

Definition at line 60 of file DialogWindow.hpp.


The documentation for this class was generated from the following files: