All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
resource.hpp File Reference

Classes

struct  KzuResourceLoaderThreadContext
 Resource loader thread specific data. More...
 
class  kanzi::Resource
 Represents the base class for all resources. More...
 

Namespaces

 kanzi
 

Macros

#define KZU_RESOURCE_PROFILING_MESH_KZB
 Profiling tag for mesh. More...
 
#define KZU_RESOURCE_PROFILING_MESH_DEPLOY
 Profiling tag for mesh deploy. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_2D_KZB
 Profiling tag for 2d texture. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_2D_DEPLOY
 Profiling tag for 2d texture deploy. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_CUBE_KZB
 Profiling tag for cubemap texture. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_CUBE_DEPLOY
 Profiling tag for cubemap texture deploy. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_2D_KZB
 Profiling tag for 2d render target texture. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_2D_DEPLOY
 Profiling tag for 2d render target texture deploy. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_CUBE_KZB
 Profiling tag for cubemap render target texture. More...
 
#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_CUBE_DEPLOY
 Profiling tag for cubemap render target texture deploy. More...
 
#define KZU_RESOURCE_PROFILING_SHADER_KZB
 Profiling tag for shader. More...
 
#define KZU_RESOURCE_PROFILING_SHADER_DEPLOY
 Profiling tag for shader deploy. More...
 
#define KZU_RESOURCE_PROFILING_MATERIAL_KZB
 Profiling tag for material. More...
 
#define KZU_RESOURCE_PROFILING_STYLE_KZB
 Profiling tag for style. More...
 
#define KZU_RESOURCE_PROFILING_STATE_MANAGER_KZB
 Profiling tag for state manager. More...
 
#define KZU_RESOURCE_PROFILING_TIMELINE_SEQUENCE_KZB
 Profiling tag for timeline sequence. More...
 
#define KZU_RESOURCE_PROFILING_ANIMATION_CLIP_KZB
 Profiling tag for animation clip. More...
 
#define KZU_RESOURCE_PROFILING_ANIMATION_KZB
 Profiling tag for animation. More...
 
#define KZU_RESOURCE_PROFILING_COMPOSER_KZB
 Profiling tag for composer. More...
 
#define KZU_RESOURCE_PROFILING_OBJECT_NODE_KZB
 Profiling tag for object node. More...
 
#define KZU_RESOURCE_PROFILING_PREFAB_TEMPLATE_KZB
 Profiling tag for prefab template. More...
 
#define KZU_RESOURCE_PROFILING_PREFAB_TEMPLATE_NODE_KZB
 Profiling tag for prefab template. More...
 
#define KZU_RESOURCE_PROFILING_GENERIC_FILE_KZB
 Profiling tag for prefab template. More...
 
#define KZU_RESOURCE_PROFILING_TRAJECTORY_KZB
 Profiling tag for trajectory. More...
 
#define KZU_RESOURCE_PROFILING_OBJECT_SOURCE_KZB
 Profiling tag for object source. More...
 
#define KZU_RESOURCE_PROFILING_FONT_KZB
 Profiling tag for font. More...
 

Typedefs

typedef weak_ptr< Resource > kanzi::ResourceWeakPtr
 

Enumerations

enum  KzuResourceLoadState { KZU_RESOURCE_LOAD_STATE_INVALID, KZU_RESOURCE_LOAD_STATE_NOT_LOADED, KZU_RESOURCE_LOAD_STATE_QUEUED_FOR_LOADING, KZU_RESOURCE_LOAD_STATE_LOADED }
 Resource loading state. More...
 
enum  KzuResourceLoadingStrategy { KZU_RESOURCE_LOADING_STRATEGY_DEFAULT, KZU_RESOURCE_LOADING_STRATEGY_MANUAL, KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_SPEED, KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_MEMORY }
 Resource loading strategy specifies when the resource is loaded and unloaded. More...
 

Macro Definition Documentation

#define KZU_RESOURCE_PROFILING_MESH_KZB

Profiling tag for mesh.

#define KZU_RESOURCE_PROFILING_MESH_DEPLOY

Profiling tag for mesh deploy.

#define KZU_RESOURCE_PROFILING_TEXTURE_2D_KZB

Profiling tag for 2d texture.

#define KZU_RESOURCE_PROFILING_TEXTURE_2D_DEPLOY

Profiling tag for 2d texture deploy.

#define KZU_RESOURCE_PROFILING_TEXTURE_CUBE_KZB

Profiling tag for cubemap texture.

#define KZU_RESOURCE_PROFILING_TEXTURE_CUBE_DEPLOY

Profiling tag for cubemap texture deploy.

#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_2D_KZB

Profiling tag for 2d render target texture.

#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_2D_DEPLOY

Profiling tag for 2d render target texture deploy.

#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_CUBE_KZB

Profiling tag for cubemap render target texture.

#define KZU_RESOURCE_PROFILING_TEXTURE_RENDER_TARGET_CUBE_DEPLOY

Profiling tag for cubemap render target texture deploy.

#define KZU_RESOURCE_PROFILING_SHADER_KZB

Profiling tag for shader.

#define KZU_RESOURCE_PROFILING_SHADER_DEPLOY

Profiling tag for shader deploy.

#define KZU_RESOURCE_PROFILING_MATERIAL_KZB

Profiling tag for material.

#define KZU_RESOURCE_PROFILING_STYLE_KZB

Profiling tag for style.

#define KZU_RESOURCE_PROFILING_STATE_MANAGER_KZB

Profiling tag for state manager.

#define KZU_RESOURCE_PROFILING_TIMELINE_SEQUENCE_KZB

Profiling tag for timeline sequence.

#define KZU_RESOURCE_PROFILING_ANIMATION_CLIP_KZB

Profiling tag for animation clip.

#define KZU_RESOURCE_PROFILING_ANIMATION_KZB

Profiling tag for animation.

#define KZU_RESOURCE_PROFILING_COMPOSER_KZB

Profiling tag for composer.

#define KZU_RESOURCE_PROFILING_OBJECT_NODE_KZB

Profiling tag for object node.

#define KZU_RESOURCE_PROFILING_PREFAB_TEMPLATE_KZB

Profiling tag for prefab template.

#define KZU_RESOURCE_PROFILING_PREFAB_TEMPLATE_NODE_KZB

Profiling tag for prefab template.

#define KZU_RESOURCE_PROFILING_GENERIC_FILE_KZB

Profiling tag for prefab template.

#define KZU_RESOURCE_PROFILING_TRAJECTORY_KZB

Profiling tag for trajectory.

#define KZU_RESOURCE_PROFILING_OBJECT_SOURCE_KZB

Profiling tag for object source.

#define KZU_RESOURCE_PROFILING_FONT_KZB

Profiling tag for font.

Enumeration Type Documentation

Resource loading state.

Enumerator
KZU_RESOURCE_LOAD_STATE_INVALID 

A loader for the resource is not available and no data has been provided for the resource to mark it in LOADED state.

KZU_RESOURCE_LOAD_STATE_NOT_LOADED 

The resource has not yet been loaded.

KZU_RESOURCE_LOAD_STATE_QUEUED_FOR_LOADING 

The resource is in queue waiting to be loaded.

KZU_RESOURCE_LOAD_STATE_LOADED 

The resource has been loaded.

Resource loading strategy specifies when the resource is loaded and unloaded.

Enumerator
KZU_RESOURCE_LOADING_STRATEGY_DEFAULT 

When using the default strategy the engine loads the resource before it is needed.

The loading strategy depends on the platform and Kanzi application, but the engine optimizes the loading strategy.

KZU_RESOURCE_LOADING_STRATEGY_MANUAL 

When using the manual loading strategy you must load and unload the resource manually by calling the kzuResourceLoad and kzuResourceUnload functions.

This is the only loading strategy that you can control completely.

KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_SPEED 

When using the optimize speed strategy the engine keeps the resource in RAM.

When the application needs the resource, the engine can deploy the resource from RAM to GPU as fast as possible. The engine releases the resource from RAM only when the resource is not accessible anymore. This strategy guarantees that the engine does not unload the resource during runtime.

KZU_RESOURCE_LOADING_STRATEGY_OPTIMIZE_MEMORY 

When using the optimize memory loading strategy the engine unloads the resource as soon as possible.

The engine releases the GPU resources from RAM after deploying the resources.