![]() |
Skylicht Engine
|
Base class for managing the application lifecycle, rendering, and event system in Skylicht Engine. More...
#include <CBaseApp.h>
Public Types | |
| typedef std::pair< std::string, IApplicationEventReceiver * > | appEventType |
| Type for mapping application event receivers by name. | |
Public Member Functions | |
| CBaseApp () | |
| Default constructor for CBaseApp. | |
| virtual | ~CBaseApp () |
| Destructor for CBaseApp. | |
| const char * | getAppName () |
| Get the name of the application. | |
| void | showDebugConsole () |
| Show debug console (Windows only). | |
| IrrlichtDevice * | getDevice () |
| Get the Irrlicht device. | |
| IVideoDriver * | getDriver () |
| Get the Irrlicht video driver. | |
| io::IFileSystem * | getFileSystem () |
| Get the Irrlicht file system. | |
| void | setClearColor (const video::SColor &c) |
| Set the color used to clear the screen before rendering. | |
| SExposedVideoData & | getVideoData () |
| Get exposed video data for rendering pipeline. | |
| float | getTimeStep () |
| Get the time step for the current frame. | |
| io::path | getBuiltInPath (const char *name) |
| Get built-in asset path based on platform. | |
| std::string | getTexturePackageName (const char *name, const char *ext=".zip") |
| Get texture package name based on platform and compression support. | |
| void | showFPS (bool b) |
| Show or hide FPS in window caption. | |
| int | getWidth () |
| Get the screen width. | |
| int | getHeight () |
| Get the screen height. | |
| float | getSizeRatio () |
| Get the screen aspect ratio (width/height). | |
| bool | isWideScreen () |
| Check if screen is widescreen format. | |
| void | clearScreenTime (float t) |
| Set the duration to clear the screen before rendering. | |
| void | enableRender (bool b) |
| Enable or disable rendering. | |
| bool | isRenderEnabled () |
| Check if rendering is enabled. | |
| void | registerAppEvent (const std::string &name, IApplicationEventReceiver *pEvent) |
| Register a new application event receiver. | |
| void | unRegisterAppEvent (IApplicationEventReceiver *pEvent) |
| Unregister an application event receiver. | |
| void | sendEventToAppReceiver (int eventID, int param1=0, int param2=0) |
| Send an event to all registered application event receivers. | |
| void | setLimitFPS (int fps) |
| Set the FPS limit for the application. | |
| int | getLimitFPS () |
| Get the FPS limit. | |
| void | enableRunWhenPause (bool b) |
| Enable or disable running logic when the application is paused. | |
| void | openURL (const char *url) |
| Open browse with url. | |
| bool | isNetworkAvailable () |
| Check network available or not? | |
Static Public Member Functions | |
| static void | reportLeakMemory () |
| Report memory leaks (Visual Leak Detector, debug only). | |
Public Attributes | |
| std::vector< appEventType > | m_appEventReceivers |
| List of registered application event receivers. | |
Protected Attributes | |
| IrrlichtDevice * | m_device |
| Irrlicht device pointer. | |
| IVideoDriver * | m_driver |
| Video driver pointer. | |
| io::IFileSystem * | m_fileSystem |
| File system pointer. | |
| SExposedVideoData | m_videoData |
| float | m_timeStep |
| Time step for each frame(ms). | |
| float | m_totalTime |
| Total elapsed time since app started(ms). | |
| int | m_limitFPS |
| FPS limit(-1 for unlimited). | |
| bool | m_showFPS |
| Flag to display FPS in window caption. | |
| float | m_clearScreenTime |
| Time to clear screen before rendering. | |
| bool | m_renderEnabled |
| Flag to enable / disable rendering. | |
| bool | m_enableRunWhenPause |
| video::SColor | m_clearColor |
| Color used to clear the screen. | |
| std::string | m_appName |
| Application name. | |
Base class for managing the application lifecycle, rendering, and event system in Skylicht Engine.
CBaseApp handles basic properties such as device, video driver, file system, timing, rendering, and application events. It provides API to manage event receivers, screen properties, rendering, FPS control, and utility functions for resource management.
|
inline |
Set the duration to clear the screen before rendering.
| t | Time in milliseconds. |
|
inline |
Enable or disable rendering.
| b | True to enable rendering, false to disable. |
|
inline |
Enable or disable running logic when the application is paused.
| b | True to enable, false to disable. |
|
inline |
Get the name of the application.
| io::path Skylicht::CBaseApp::getBuiltInPath | ( | const char * | name | ) |
Get built-in asset path based on platform.
| name | Asset name. |
|
inline |
Get the Irrlicht device.
|
inline |
Get the Irrlicht video driver.
|
inline |
Get the Irrlicht file system.
| int Skylicht::CBaseApp::getHeight | ( | ) |
Get the screen height.
| float Skylicht::CBaseApp::getSizeRatio | ( | ) |
Get the screen aspect ratio (width/height).
| std::string Skylicht::CBaseApp::getTexturePackageName | ( | const char * | name, |
| const char * | ext = ".zip" ) |
Get texture package name based on platform and compression support.
| name | Base texture name. |
| ext | Base ext. (e.g ".zip", ".npk") |
|
inline |
Get the time step for the current frame.
|
inline |
Get exposed video data for rendering pipeline.
| int Skylicht::CBaseApp::getWidth | ( | ) |
Get the screen width.
|
inline |
Check if rendering is enabled.
| bool Skylicht::CBaseApp::isWideScreen | ( | ) |
Check if screen is widescreen format.
| void Skylicht::CBaseApp::registerAppEvent | ( | const std::string & | name, |
| IApplicationEventReceiver * | pEvent ) |
Register a new application event receiver.
| name | Name of the receiver. |
| pEvent | Pointer to IApplicationEventReceiver. |
| void Skylicht::CBaseApp::sendEventToAppReceiver | ( | int | eventID, |
| int | param1 = 0, | ||
| int | param2 = 0 ) |
Send an event to all registered application event receivers.
| eventID | Event type identifier. |
| param1 | Optional integer parameter (e.g., width for resize). |
| param2 | Optional integer parameter (e.g., height for resize). |
| void Skylicht::CBaseApp::setClearColor | ( | const video::SColor & | c | ) |
Set the color used to clear the screen before rendering.
| c | Color value. |
| void Skylicht::CBaseApp::setLimitFPS | ( | int | fps | ) |
Set the FPS limit for the application.
| fps | Target FPS value, -1 for unlimited |
|
inline |
Show or hide FPS in window caption.
| b | True to show FPS, false to hide. |
| void Skylicht::CBaseApp::unRegisterAppEvent | ( | IApplicationEventReceiver * | pEvent | ) |
Unregister an application event receiver.
| pEvent | Pointer to IApplicationEventReceiver to remove. |