#include <kanzi/example_application.hpp>
Public Member Functions | |
virtual void | onConfigure (ApplicationProperties &configuration) KZ_OVERRIDE |
User-defined configuration. More... | |
virtual void | registerMetadataOverride (ObjectFactory &) KZ_OVERRIDE |
virtual void | onKeyInputEvent (const KzsInputEventKey *inputData) KZ_OVERRIDE |
Event callback for keyboard input events. More... | |
Public Member Functions inherited from kanzi::Application | |
Application () | |
Constructs the application object. More... | |
virtual | ~Application () |
Destructs the application object. More... | |
void | initialize (const SystemProperties &systemProperties) |
Initializes the application to a consistent state. More... | |
void | uninitialize () |
Uninitializes the application. More... | |
void | initializeGL () |
Initializes the graphics language subsystem. More... | |
void | uninitializeGL () |
Uninitializes the graphics language subsystem. More... | |
void | suspendGL () |
Suspends the graphics language subsystem. More... | |
void | resumeGL () |
Resumes the graphics language subsystem. More... | |
Domain * | getDomain () const |
Access domain. More... | |
Renderer3D * | getRenderer3D () const |
Access the renderer. More... | |
Node2DSharedPtr | getRoot () const |
Access root node. More... | |
ScreenSharedPtr | getScreen () const |
Access screen. More... | |
void | setScreen (ScreenSharedPtr screen) |
Set screen. More... | |
KzuTaskScheduler * | getTaskScheduler () const |
Access engine task scheduler. More... | |
void | queueTaskExecuteOnce (string_view taskName, Scheduler::Task task) |
Queue a task to be executed once by the internal task scheduler. More... | |
ResourceManager * | getResourceManager () const |
Access resource manager. More... | |
KzuInputManager * | getInputManager () const |
Access input manager. More... | |
KzuBinaryLoader * | getBinaryLoader () const |
Access binary loader. More... | |
KzuMessageDispatcher * | getMessageDispatcher () const |
Access message dispatcher. More... | |
float | getFramesPerSecond () const |
Access FPS info. More... | |
virtual void | projectReloaded () |
size_t | getGraphicsOutputCount () const |
Access graphics output count. More... | |
GraphicsOutputSharedPtr | getGraphicsOutput (size_t index=0) const |
Access graphics outputs. More... | |
void | appendGraphicsOutput (GraphicsOutputSharedPtr graphicsOutput) |
Attach graphics output. More... | |
void | removeGraphicsOutput (size_t index=0) |
Remove graphics output. More... | |
size_t | getEventSourceCount () const |
Access event source count. More... | |
EventSourceSharedPtr | getEventSource (size_t index=0) const |
Access event sources. More... | |
void | appendEventSource (EventSourceSharedPtr eventSource) |
Attach event source. More... | |
void | removeEventSource (size_t index=0) |
Remove event source. More... | |
State | getState () |
Access application state. More... | |
chrono::microseconds | getLastFrameTime () const |
Gets time taken to render last frame. More... | |
ApplicationProperties | getApplicationProperties () const |
Access application properties. More... | |
void | main (const SystemProperties &systemProperties) |
Application entry point. More... | |
void | run () |
Application main loop. More... | |
void | update (chrono::milliseconds deltaTime) |
Updates application logic. More... | |
void | render () |
Renders the root layer. More... | |
void | suspend () |
Suspends the thread for the remainder of the frame. More... | |
void | yield () |
Irrevocably suspends the thread for the remainder of the frame. More... | |
void | progressDeploymentQueue () |
Processes the deployment queue for asynchronous loading tasks. More... | |
void | sleep () |
Puts the application to sleep as soon as possible. More... | |
void | wakeup () |
Wakes up the application from sleep as soon as possible. More... | |
void | quit () |
Quits the application as soon as possible. More... | |
void | beginFrame (const GraphicsOutput &graphicsOutput) |
void | renderFrame1 (const GraphicsOutput &graphicsOutput, bool toolPresent, const RenderPassSharedPtr &debugComposer) |
void | renderFrame2 () |
void | renderFrame3 () |
void | postRender (const GraphicsOutput &graphicsOutput) |
void | endFrame () |
void | update1 (chrono::milliseconds deltaTime, const GraphicsOutput &graphicsOutput, kzBool) |
void | update2 (chrono::milliseconds deltaTime, const GraphicsOutput &graphicsOutput, kzBool toolPresent, kzBool centerViewport) |
void | executePendingChanges (kzBool toolPresent) |
void | projectReloaded (bool isToolPresent) |
void | initializeProject (kzBool toolPresent) |
void | initializeProjectTask (kzBool toolPresent) |
void | reloadProject (kzUint byteCount, const byte *bytes, bool isToolPresent) |
void | reloadProjectFromFile (kzString binaryPath, bool isToolPresent) |
void | reloadProjectFromFileResource (kzString resourceFile, bool isToolPresent) |
void | initializeGLContext () |
void | uninitializeGLContext () |
ApplicationProperties::PerformanceInfoLevel | getPerformanceInfoLevel () const |
Gets performance info level. More... | |
void | setPerformanceInfoLevel (ApplicationProperties::PerformanceInfoLevel level) |
Sets performance info level. More... | |
StopWatch & | getStopWatch () |
Gets default main loop timer. More... | |
void | setAllowIndefiniteSleep (bool enabled) |
Sets or resets flag for allowing indefinite sleep. More... | |
bool | isRenderRequired () const |
Returns whether an immediate redraw is needed. More... | |
Public Member Functions inherited from kanzi::Module | |
Module () | |
virtual MetaclassContainer | getMetaclassesOverride () |
virtual void | destroy () |
void | setDomain (Domain *domain) |
Set the domain. More... | |
Additional Inherited Members | |
Public Types inherited from kanzi::Application | |
enum | State { Uninitialized, Running, Sleeping, Quitting, Error } |
Enumeration for different application states. More... | |
Public Types inherited from kanzi::Module | |
typedef vector< const Metaclass * > | MetaclassContainer |
typedef MetaclassContainer::iterator | MetaclassIterator |
Protected Member Functions inherited from kanzi::Application | |
virtual void | onStartup () |
Function callback for application start. More... | |
virtual void | onShutdown () |
Function callback for application end. More... | |
virtual void | onProjectLoaded () |
Function callback for initialization that is using the .KZB data. This function is called right after the .KZB binaries have been loaded. More... | |
virtual void | onUpdate (chrono::milliseconds deltaTime) |
Function callback for updating logic. More... | |
virtual void | onPreRender () |
Function callback for rendering. This function is called for every frame before any other rendering function. More... | |
virtual void | onPostRender () |
Function callback for rendering. This function is called for every frame after the root layer has been rendered. More... | |
virtual void | onPointerInputEvent (const KzsInputEventPointer *inputData) |
Event callback for pointing device (e.g. mouse or touch screen) input events. More... | |
virtual void | onIdle () |
Event callback for idle loop. More... | |
virtual void | onSleep () |
Event callback for application sleep. More... | |
virtual void | onWakeup () |
Event callback for application wakeup. More... | |
virtual void | initializeOverride (const SystemProperties &systemProperties) |
Override function for initialize(). More... | |
virtual void | uninitializeOverride () |
Override function for uninitialize(). More... | |
virtual void | initializeGLOverride () |
Override function for initializeGL(). More... | |
virtual void | uninitializeGLOverride () |
Override function for uninitializeGL(). More... | |
virtual void | suspendGLOverride () |
Override function for suspendGL(). More... | |
virtual void | resumeGLOverride () |
Override function for resumeGL(). More... | |
virtual void | mainOverride (const SystemProperties &systemProperties) |
Override function for main(). More... | |
virtual void | updateOverride (chrono::milliseconds deltaTime) |
Override function for update(). More... | |
virtual void | renderOverride () |
Override function for render(). More... | |
virtual void | suspendOverride () |
Override function for suspend(). More... | |
virtual void | yieldOverride () |
Override function for yield(). More... | |
virtual void | sleepOverride () |
Override function for sleep(). More... | |
virtual void | wakeupOverride () |
Override function for wakeup(). More... | |
virtual void | onProjectInitialized () |
virtual void | progressDeploymentQueueOverride () |
Override function for progressDeploymentQueue(). More... | |
virtual void | initializeProperties (const SystemProperties &systemProperties) |
virtual void | initializeEngine () |
virtual void | initializeSystem () |
void | projectInitialized () |
void | projectLoaded () |
virtual void | renderEngine () |
virtual void | handleEvents (const KzsEventQueue *eventQueue) |
virtual bool | isToolPresent () const |
virtual void | runOverride () |
Override function for run(). More... | |
void | idle () |
void | idleLoop () |
void | loadPlugins () |
void | logGraphicsInformation () |
Log graphics information based on application properties. More... | |
KzuEngine * | getEngine () const |
Access engine. More... | |
PerformanceInfo & | acquirePerformanceInfo () |
Acquire performance info object. More... | |
optional< chrono::milliseconds > | getProposedSleepTime (chrono::milliseconds deltaTime) |
Gets the time main thread can sleep in milliseconds, supposing given duration would have passed from the start of the frame. More... | |
chrono::milliseconds | getProposedSleepTimePostRender (chrono::milliseconds deltaTime) |
Gets the time the main thread can sleep after rendering. More... | |
Protected Member Functions inherited from kanzi::Module | |
virtual | ~Module () |
Protected Attributes inherited from kanzi::Application | |
vector< EventSourceSharedPtr > | m_eventSources |
Container for event sources. More... | |
vector< GraphicsOutputSharedPtr > | m_graphicsOutputs |
Container for graphics outputs. More... | |
State | m_state |
Current state of the application. More... | |
SystemProperties | m_systemProperties |
System properties. More... | |
ApplicationProperties | m_applicationProperties |
Application properties. More... | |
KzcMemoryManager * | m_systemMemoryManager |
System memory manager (legacy). More... | |
KzsEventQueue * | m_eventQueue |
The event queue for user input and window events. More... | |
KzsEventQueue * | m_eventQueueBuffer |
Temporary event queue used for combining similar events. More... | |
KzuEngine * | m_engine |
Engine instance. More... | |
Scheduler | m_scheduler |
Execution scheduler. More... | |
unique_ptr< PerformanceInfo > | m_performanceInfo |
Performance info. More... | |
bool | m_projectLoaded |
Flag to be set when project has been loaded. More... | |
SuspensionManager | m_suspensionManager |
Suspension manager for main loop. More... | |
Protected Attributes inherited from kanzi::Module | |
Domain * | m_domain |
The domain this module is registered to. More... | |
|
inlinevirtual |
User-defined configuration.
This callback is called after application.cfg is read, but before the graphics language subsystem is initialized.
configuration | Allows modification of the application properties. |
Reimplemented from kanzi::Application.
|
inlinevirtual |
Reimplemented from kanzi::Module.
|
inlinevirtual |
Event callback for keyboard input events.
Reimplemented from kanzi::Application.