kanzi::ExampleApplication Class Reference

#include <kanzi/example_application.hpp>

Inheritance diagram for kanzi::ExampleApplication:
kanzi::Application kanzi::Module

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...
 
DomaingetDomain () const
 Access domain. More...
 
Renderer3DgetRenderer3D () 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...
 
KzuTaskSchedulergetTaskScheduler () 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...
 
ResourceManagergetResourceManager () const
 Access resource manager. More...
 
InputManagergetInputManager () const
 Access input manager. More...
 
KzuBinaryLoadergetBinaryLoader () const
 Access binary loader. More...
 
KzuMessageDispatchergetMessageDispatcher () 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...
 
StopWatchgetStopWatch ()
 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 ()
 
void logStartupProfilingData () const
 To log startup profiling data, use logStartupProfilingData(). More...
 
StartupProfilerRegistrygetStartupProfilerRegistry () const
 To get startup profiler registry use, getStartupProfilerRegistry(). More...
 
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...
 
KzuEnginegetEngine () const
 Access engine. More...
 
PerformanceInfoacquirePerformanceInfo ()
 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< EventSourceSharedPtrm_eventSources
 Container for event sources. More...
 
vector< GraphicsOutputSharedPtrm_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...
 
KzcMemoryManagerm_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...
 
KzuEnginem_engine
 Engine instance. More...
 
Scheduler m_scheduler
 Execution scheduler. More...
 
unique_ptr< PerformanceInfom_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...
 
FPSConstraints m_fpsConstraints
 FPS constraints for main loop. More...
 
- Protected Attributes inherited from kanzi::Module
Domainm_domain
 The domain this module is registered to. More...
 

Member Function Documentation

virtual void kanzi::ExampleApplication::onConfigure ( ApplicationProperties configuration)
inlinevirtual

User-defined configuration.

This callback is called before the application.cfg is read, and before the graphics subsystem is initialized.

Parameters
configurationAllows modification of the application properties.

Reimplemented from kanzi::Application.

virtual void kanzi::ExampleApplication::registerMetadataOverride ( ObjectFactory )
inlinevirtual

Reimplemented from kanzi::Module.

virtual void kanzi::ExampleApplication::onKeyInputEvent ( const KzsInputEventKey *  inputData)
inlinevirtual

Event callback for keyboard input events.

Reimplemented from kanzi::Application.


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