Kanzi 4 beta migration guide¶
Use this migration guide to update Kanzi applications from Kanzi 3.9 to Kanzi 4.0.
Note
Depending on your projects reliance on changes mentioned herein, it may require less effort to assemble a new project on Kanzi 4.0.0 than migrating.
Upgrade to Visual Studio 2022¶
Kanzi no longer supports Kanzi Engine libraries for Visual Studio 2017 and 2019.
For Kanzi Studio projects with a Kanzi Engine plugin, rebuild the plugin with Visual Studio 2022 and import the plugin DLL to the Kanzi Studio project.
Introduction of Kanzi Graphics¶
Introduction of Kanzi Graphics changes how Kanzi applications interact with the Kanzi rendering subsystem.
Most functions in the Renderer class were removed. Use the Kanzi Graphics API with the configured backend (Open GL, Open GL ES, or Vulkan) instead.
Kanzi Graphics consists of these major parts:
Create objects with the
gfx::createfunction and theGraphicsCreateInfostructs.Kanzi records
GraphicsCommandsinto a command buffer, and Kanzi Graphics backend processes these commands for a specific graphics API.For Kanzi Studio projects with a Kanzi Engine plugin, the plugin DLL needs to be re-imported to the Kanzi Studio project.
Rebuild the plugin using Kanzi 4.0.0 beta2.
In the Library > Kanzi Engine Plugins, delete the Kanzi Engine plugin and import the updated Kanzi Engine plugin.
Removed these classes, members, or functions:
kanzi::acquireUniformLocationkanzi::getUniformElementCountkanzi::GLBufferHandlekanzi::GLFramebufferHandlekanzi::GlGraphicsLogScopekanzi::GlGraphicsAdapterkanzi::GlGraphicsAdapterCallGleskanzi::GlGraphicsAdapterCallOpenGlkanzi::GlGraphicsAdapterCheckForErrorskanzi::GlGraphicsAdapterLoggerkanzi::GLGraphicsOutputkanzi::GLProgramHandlekanzi::GLRenderbufferHandlekanzi::GlRenderState::acquireUniformLocationkanzi::GlRenderState::allocateValueskanzi::GlRenderState::RenderValueUnionkanzi::GlRenderState::RenderValueInfokanzi::GlRenderState::TextureRenderValuekanzi::GlRenderValueBasekanzi::GLShaderHandlekanzi::GLTextureHandlekanzi::GlTextureRenderValuekanzi::Mesh::bindkanzi::Mesh::bindAttributekanzi::Mesh::bindAttributeskanzi::Mesh::bindIndicieskanzi::Renderer::getActiveGraphicsContextkanzi::Renderer::getActiveSurfaceVendorkanzi::Renderer::getUniformLocationSlowkanzi::Renderer::getUniformArrayLengthkanzi::Renderer::setUniformIntArraykanzi::Renderer::setUniformFloatArraykanzi::Renderer::setUniformVecArraykanzi::Renderer::setUniformColorArraykanzi::Renderer::setUniformMatArraykanzi::Renderer::setUniformIntegerkanzi::Renderer::setUniformFloatkanzi::Renderer::setUniformVec2kanzi::Renderer::setUniformVec3kanzi::Renderer::setUniformVec4kanzi::Renderer::setUniformColorRGBAkanzi::Renderer::setUniformMatrix3x3kanzi::Renderer::setUniformMatrix4x4kanzi::Renderer::setActiveScalarkanzi::Renderer::getActiveScalarkanzi::Renderer::calculateProjectionCameraWorldMatrixkanzi::Renderer::applyFixedUniformTimekanzi::Renderer::applyFixedUniformWindowSizekanzi::Renderer::applyTransformationUniformkanzi::Renderer::applyTransformationkanzi::Renderer::applyTextureSizeUniformskanzi::Renderer::applyTexturekanzi::Renderer::detachTexturekanzi::Renderer::setUniformTexturekanzi::Renderer::generateTexturekanzi::Renderer::deleteTexturekanzi::Renderer::setTextureAddressingModekanzi::Renderer::setTextureSwizzleMaskkanzi::Renderer::setTextureSwizzleEachChannelkanzi::Renderer::deleteShaderProgramkanzi::Renderer::deleteShaderkanzi::Renderer::generateFramebufferkanzi::Renderer::deleteFramebufferkanzi::Renderer::invalidateFramebufferAttachmentskanzi::Renderer::framebufferRenderbufferkanzi::Renderer::generateRenderbufferkanzi::Renderer::deleteRenderbufferkanzi::Renderer::bindRenderbufferkanzi::Renderer::renderbufferStoragekanzi::Renderer::generateBufferkanzi::Renderer::setVertexBufferDatakanzi::Renderer::setIndexBufferDatakanzi::Renderer::setVertexBufferSubDatakanzi::Renderer::setIndexBufferSubDatakanzi::Renderer::deleteBufferkanzi::Renderer::BufferAccessModekanzi::Renderer::mapVertexBufferkanzi::Renderer::unmapVertexBufferkanzi::Renderer::mapIndexBufferkanzi::Renderer::unmapIndexBufferkanzi::Renderer::enableVertexAttributeArraykanzi::Renderer::disableVertexAttributeArraykanzi::Renderer::getActiveShaderHandlekanzi::Renderer::getActiveShaderAttributeMapkanzi::Renderer::beginMaterialSetupkanzi::Renderer::endMaterialSetupkanzi::Renderer::pushStatisticskanzi::Renderer::popStatisticskanzi::Renderer::getIndexCountkanzi::Renderer::getTriangleCountkanzi::Renderer::getVertexCountkanzi::Renderer::getInstanceCountkanzi::Renderer::getBatchCountkanzi::Renderer::getShaderSwitchCountkanzi::Renderer::getUniformSendCountkanzi::Renderer::getTextureSwitchCountkanzi::Renderer::getFramebufferSwitchCountkanzi::Renderer::getBufferSwitchCountkanzi::Renderer::getHeavyweightCallCountkanzi::Renderer::getHalfFloatVertexAttributeSupportkanzi::Renderer::getTexStorageSupportkanzi::Renderer::getGLFormatTripletkanzi::Renderer::clearUniformCacheskanzi::Renderer::TextureUnitInfokanzi::Renderer::RenderingChangeStateFlagkanzi::Renderer::refreshRenderContextkanzi::Renderer::enableStatekanzi::Renderer::disableStatekanzi::Renderer::setStatekanzi::Renderer::getStatekanzi::Renderer::setBlendModekanzi::Renderer::getBlendModekanzi::Renderer::setCullModekanzi::Renderer::getCullModekanzi::Renderer::setDepthTestkanzi::Renderer::getDepthTestkanzi::Renderer::setLineWidthkanzi::Renderer::getLineWidthkanzi::Renderer::clearkanzi::Renderer::resetClearTargetkanzi::Renderer::addClearTargetkanzi::Renderer::getClearModekanzi::Renderer::addClearColorkanzi::Renderer::removeClearTargetkanzi::Renderer::isClearEnabledkanzi::Renderer::setClearColorkanzi::Renderer::setClearDepthValuekanzi::Renderer::setClearStencilkanzi::Renderer::setColorWriteModekanzi::Renderer::getColorWriteModekanzi::Renderer::setViewportkanzi::Renderer::getViewportkanzi::Renderer::setScissorTestkanzi::Renderer::getScissorkanzi::Renderer::setVertexBufferkanzi::Renderer::setIndexBufferkanzi::Renderer::drawBufferskanzi::Renderer::setVertexCountkanzi::Renderer::setIndexCountkanzi::Renderer::setIndexDatakanzi::Renderer::setInstanceCountkanzi::Renderer::setActiveTextureUnitkanzi::Renderer::bindTexturekanzi::Renderer::setTextureImage2Dkanzi::Renderer::setTextureSubImage2Dkanzi::Renderer::textureStoragekanzi::Renderer::generateMipMapskanzi::Renderer::setTextureFilterkanzi::Renderer::setTextureComparekanzi::Renderer::setTextureMaximumLevelkanzi::Renderer::createShaderkanzi::Renderer::createShaderProgramkanzi::Renderer::attachShaderToProgramkanzi::Renderer::detachShaderFromProgramkanzi::Renderer::bindAttributeToLocationkanzi::Renderer::linkShaderProgramkanzi::Renderer::compileSourceShaderkanzi::Renderer::deployBinaryShaderkanzi::Renderer::deployBinaryProgramkanzi::Renderer::loadProgramFromCachekanzi::Renderer::saveProgramToCachekanzi::Renderer::getCacheFilePathkanzi::Renderer::updateSettingskanzi::Renderer::getProgramBinarykanzi::Renderer::isFramebufferCompletekanzi::Renderer::framebufferTexture2Dkanzi::Renderer::applyVertexAttributeArrayskanzi::Renderer::setVertexBufferPointerkanzi::Renderer::setVertexBufferPointerkanzi::Renderer::setActiveShaderHandlekanzi::Renderer::setActiveFramebufferkanzi::Renderer::setColorBufferCountkanzi::Renderer::getActiveFramebufferkanzi::Renderer::beginVertexArraykanzi::Renderer::setVertexArrayDatakanzi::Renderer::endVertexArraykanzi::Renderer::getCurrentVertexArrayFlagskanzi::Renderer::getCurrentVertexArrayAttributeDatakanzi::Renderer::isShaderBinaryFormatSupportedkanzi::Renderer::isProgramBinaryFormatSupportedkanzi::Renderer::applyAttributePointerkanzi::Renderer::supportsTexStoragekanzi::Renderer::setHasTessellationShaderkanzi::Renderer::setFillModekanzi::Renderer::readPixelskanzi::Renderer::setPixelStorePackkanzi::Renderer::setPixelStoreUnpackkanzi::Shader::UniformProperty::uniformLocationkanzi::Shader::hasSamplersWithoutPropertieskanzi::Shader::getTextureUniformLocationkanzi::Texture::deployImageskzsGlGraphicsContextCreatekzsGlGraphicsContextDestroykzsGlGraphicsContextSetActivekzsGlGraphicsContextGetAdapterkzsGlGraphicsContextIsKhrDebugSupportedkzsGlGraphicsContextGetVendorkzsGlGraphicsContextGetSurfaceClientAPIkzsGlGraphicsContextGetAPIkzsGlIsExtensionSupportedkzsGlGraphicsContextSetLoggingkzsGlGraphicsContextGetLoggingkzsGlGraphicsContextGetDumpStateOnDrawCallskzsGlGraphicsContextSetErrorCheckingkzsGlGraphicsContextSetDebugCallbackkzsGlGraphicsContextGetGlesSymbolskzsGlGraphicsContextGetOpenGlSymbols
Removed these functions that have direct replacements:
Removed
Use instead
kanzi::captureCurrentFramebufferToImagekanzi::captureScreenToImagekanzi::GPUBuffer::getNativeHandlekanzi::Mesh::getNativeVertexBufferHandlekanzi::Mesh::getNativeIndexBufferHandlekanzi::Mesh::getNativeInstanceBufferHandlekanzi::Renderbuffer::getNativeHandlekanzi::Renderer::applyFixedUniformskanzi::Renderer::getMaximumVertexAttributeCountgfx::getDeviceProperty(gfx::DevicePropertyId::MaxVertexAttributes)kanzi::Renderer::setActiveGLGraphicsOutputRemoved the
kanzi::Geometry::drawTexturedandkanzi::Geometry::drawUntexturedfunctions. If you use these functions, you can change code like thisif (isTextured()) { geometry.drawTextured(renderer, transform, GraphicsPrimitiveTypeTriangleStrip, material); } else { geometry.drawUntextured(renderer, transform, GraphicsPrimitiveTypeTriangleStrip, material); }
to
renderer.setMatrix(FixedMatrixWorld, transform); renderState.updateTransformationUniforms(renderer); renderState.draw(renderer, geometry);
Changes to the Renderer API¶
Removed the
Renderer3Dclass. Kanzi used theRenderer3Dclass to store temporary properties during 3D rendering and provided debug functionality for the Preview.This version of Kanzi moves:
The rendering to the
DebugRenderRegistryandDebugVisualizationclassesThe 3D rendering specifics are now handled by render passes, such as
GatherLightsRenderPass
In your application code, change all uses of
Renderer3Dto useRenderer. This includes all virtual functions that haveRenderer3Dpassed as a parameter.Moved these functions from the
Renderer3Dclass to theRendererclass:Removed these functions because of refactoring related to the removal of the
Renderer3Dclass. Most of the removed functions are related to debug rendering:Renderer::bindFramebufferRenderer::setActiveFramebufferCallbackRenderer::setDefaultFramebufferRenderer3D::addVertexAndNormalToFloatArraysRenderer3D::addVertexToFloatArrayRenderer3D::applyBoolPropertyRenderer3D::applyColorMaterialRenderer3D::applyColorPropertyRenderer3D::applyFloatPropertyRenderer3D::applyIntPropertyRenderer3D::applyMaterialRenderer3D::applyMaterialStrictRenderer3D::applyMatrix3x3PropertyRenderer3D::applyMatrix4x4PropertyRenderer3D::applyPropertyTypeRenderer3D::applySRT2DPropertyRenderer3D::applySRT3DPropertyRenderer3D::applyStencilSettingsRenderer3D::applyTexturePropertyRenderer3D::applyVector2PropertyRenderer3D::applyVector3PropertyRenderer3D::applyVector4PropertyRenderer3D::calculateNormalRenderer3D::drawBoxSolidNormalRenderer3D::drawLayerOutlineQuadRenderer3D::drawLayerQuadRenderer3D::drawLayerQuadWithMaterialRenderer3D::drawLineListRenderer3D::drawPrimitivesRenderer3D::drawOrientedBoundingBoxSolidNormalRenderer3D::drawPrimitiveBufferTexturedRenderer3D::drawPrimitiveBufferUntexturedRenderer3D::drawPrimitivesNormalRenderer3D::drawSelectionIndicatorRenderer3D::drawQuadRenderer3D::drawTrajectoryRenderer3D::drawUntexturedLayerQuadRenderer3D::drawViewportQuadWithTextureSpanRenderer3D::getActiveGLGraphicsOutputRenderer3D::getClearColorOverrideRenderer3D::getFloatBufferRenderer3D::getResourceManagerRenderer3D::isBoundingBoxVisualizationEnabledRenderer3D::isColorWriteDisabledRenderer3D::isSkeletonVisualizationEnabledRenderer3D::printInfoRenderer3D::removeClearColorOverrideRenderer3D::setActiveGLGraphicsOutputRenderer3D::setBoundingBoxVisualizationEnabledRenderer3D::setClearColorOverrideRenderer3D::setDefaultOrthoProjectionRenderer3D::setDisableColorWriteRenderer3D::setFramebufferCallbackRenderer3D::setLoggingRenderer3D::setSkeletonVisualizationEnabledSurface::attachSurface::attachOverride
Instead, use the
DebugVisualizationandDebugVisualizationStorageclasses to draw and store debug visualizations for nodes.The standard
DebugRenderRegistry::DebugObjectRenderingFunctionautomatically used byDebugComposerchanged to:void (*DebugObjectRenderingFunction)(Renderer& renderer, DebugRenderStorage& storage, DebugVisualization* visualization, NodeSharedPtr object);
You can access
storageto create a debug visualization structure for theNode. If you have done this on a previous frame, thevisualizationparameter is non-null and you can use it. Geometry stored in theDebugVisualizationremains until you remove theNodefrom the scene graph.Removed the
Surface::Usageenumeration.Removed the
RenderTargetModeenumeration and modifiedTexture::CreateInfoandTextureto removeGraphicsFormatFeatureandRenderTargetModesettings. The texture create info now uses a mask ofgfx::ImageUsageFlagto specify texture usage intent.Added
usageFlagsfield toTexture::CreateInfo.When creating composition targets, enable the
gfx::ImageUsageFlag::Attachmentflag. This is automatically enabled bykanzi::Texture::CreateInfoNode2DRenderTarget.gfx::ImageUsageFlag::SampledShaderResourceis enabled by default. If the texture is not sampled, remove this flag and setgfx::ImageUsageFlag::ShaderResourceinstead.Other relevant flags are enabled automatically based on texture settings: -
gfx::ImageUsageFlag::CopyDestinationfor MSAA textures. - You can manually enable additional flags, depending on the intended use, such as copy source and destination.
Removed the
GlRenderValueandGlBlendModeRenderValueclasses, andupdateRenderValuefunctions, useGlRenderStateinstead.Removed the
GraphicsPrimitiveTypeLineLoopoption from theGraphicsPrimitiveTypeenumeration. UseGraphicsPrimitiveType::GraphicsPrimitiveTypeLineStripinstead, with the first vertex duplicated at the end of the vertex list.Renamed the
GlRenderValueBindingclass toRenderValueBinding.Removed the
GPUBufferTypeenumeration. Usegfx::BufferUsageFlaginstead. When creating a new GPU buffer, use eithergfx::BufferUsageFlag::VertexBufferorgfx::BufferUsageFlag::IndexBuffer.The type of the
nativeHandleparameter changed togfx::NativeTextureHandlein theTexture::create, the overloaded method which was used to create texture from a pre-existing image object.Removed functions left unused, because of the new graphics backend:
Renderer::getColorReadFormatRenderer::getColorReadType
Changes to Data-Driven Exclusive Activity Host¶
Data-Driven Exclusive Activity Host now supports only Activities created from a data source and no longer supports manually added Activities. Use an Exclusive Activity Host instead.
Changes to List Box¶
In the
ListBoxConceptclass, renamed these messages and message arguments:Kanzi 3.9
Kanzi 4.0
ListBoxConcept::ItemHiddenMessageListBoxConcept::ItemHiddenMessageArgumentsListBoxConcept::ItemVisibleMessageListBoxConcept::ItemVisibleMessageArgumentsIn the
ListBoxConceptImplclass, renamed these public member functions:Kanzi 3.9
Kanzi 4.0
ListBoxConceptImpl::getAliveRangeListBoxConceptImpl::updateVisibleRangeQuietListBoxConceptImpl::updateVisibleRangeIn the
ListBoxTrajectoryPresenterclass, renamed these protected member functions:Kanzi 3.9
Kanzi 4.0
ListBoxTrajectoryPresenter::calculateVisibleRangeListBoxTrajectoryPresenter::updateVisibleRangeListBoxTrajectoryPresenter::extendVisibleItemRangeToItemRenamed these classes and their metaclass names:
Kanzi 3.9
Kanzi 4.0
DataSourceListItemGeneratorDataSourceListItemGenerator2DDataSourceListItemGenerator3D
Changes to the List Box nodes¶
In the Grid List Box nodes, the default directional navigation keys no longer move the item selection. In a List Box node, the default directional navigation keys now move the key focus between the focusable list items.
For example, to scroll a Grid List Box with the ↑ and ↓ keys, make the list items focusable. See Handling the key focus in a List Box node.
Changes to the ActivityCodeBehind class¶
In the Kanzi C++ API, in the
ActivityCodeBehindclass, replaced theonActive,onInactive,onActivating, andonDeactivatingcallbacks withActivityCodeBehind::onStatusChange.To migrate your Kanzi application, move the content of the
onActive,onInactive,onActivating, andonDeactivatingcallbacks to theActivityCodeBehind::onStatusChangecallback. For example, if you derive fromActivityCodeBehind, changevoid onActive() override { kzLogInfo(KZ_LOG_CATEGORY_GENERIC, ("Activity status changed: Active")); }
to
void onStatusChange(ActivityConcept::Status status) override { switch(status) { case ActivityConcept::Status::Active: kzLogInfo(KZ_LOG_CATEGORY_GENERIC, ("Activity status changed: Active")); break; } }
In both Kanzi C++ (
ActivityCodeBehind) and Kanzi Java API (ActivityCodeBehind), removedregisterStatusChange,registerStatusChangeOverride,unregisterStatusChange, andunregisterStatusChangeOverride.To migrate your Kanzi application, move the content of the registered status change callbacks to the
ActivityCodeBehind::onStatusChangecallback.For example:
If you derive from
ActivityCodeBehind, changevoid registerStatusChangeOverride() override { registerStatusChange(ActivityConcept::Status::Active, [](ActivityConcept::StatusChangedMessageArguments&) { kzLogInfo(KZ_LOG_CATEGORY_GENERIC, ("Activity status changed: Active")); }); }
to
void onStatusChange(ActivityConcept::Status status) override { switch(status) { case ActivityConcept::Status::Active: kzLogInfo(KZ_LOG_CATEGORY_GENERIC, ("Activity status changed: Active")); break; } }
If you derive from
ActivityCodeBehind, change@Override protected void registerStatusChangeOverride() { registerStatusChange(ActivityStatus.Active, (messageArguments) -> { Log.info("Activity status changed: Active"); }); }
to
@Override protected void onStatusChange(ActivityStatus status) { super.onStatusChange(status); switch(status) { case Active: Log.info("Activity status changed: Active"); break; } }
Changes to the ActivityElementImpl and ActivityHostConceptImpl classes¶
In the
ActivityHostConceptImplclass, removed methods:getActiveOrAttachedActivatinggetAttachedActivityNodesgetActivityInfo
To migrate your Kanzi application, in the classes that inherit from the
ActivityHostConceptImplclass, remove the overrides from the removed methods.The
ActivityElementImpl::onAttachedOverridemethod is no longer virtual.To migrate your Kanzi application, in the classes that inherit from the
ActivityElementImplclass, remove the overrides from theonAttachedOverridemethods that are overriding theActivityElementImpl::onAttachedOverridemethod.
Changes to the File API¶
In the File class, changed these member functions to use byte instead of char for anonymous data buffer operations:
Function |
Signature |
|---|---|
|
|
|
|
|
This change applies also to the functions in the ReadOnlyDiskFile, ReadOnlyMemoryFile, and WriteOnlyDiskFile classes, which inherit the File class.
Changes to the Pinch Manipulator¶
In the PinchManipulator class:
Removed these member functions and variables that had no effect:
Functions:
setRotationRecognitionThresholdsetScaleRecognitionThreshold
Variables:
m_rotateThresholdm_rotatingm_scaleThresholdm_scaling
Made these member variables private:
m_normalizedReferenceVectorm_previousMiddlem_referenceScalem_touchIdAm_touchIdB
Changes to application configuration¶
Removed the enumeration value
MultisamplePreference::MultisamplePreferenceImplicit. This also removes the application configuration file optionMultisamplePreference = "implicit"
This reflects a broader change, that removes the support for implicit multisampling from Kanzi Engine. From now on, Kanzi applies multisampling only when you use
Renderbufferblit or explicitly accessible samples. Rendering results are visible, as this option targeted legacy GPUs.Modified the application configuration to accept command line parameters with double dash prefix as is common practice. The new parameters for selecting graphics backend are:
--gles--opengles--gl--opengl--vk--vulkan
The new parameters for selecting windowing system are:
--egl--wgl--glx
You can use the same parameters without the double dashes in an application configuration file.
Changes to the CompositionStack¶
Simplified the use of the CompositionStack to require use of an instance owned by Renderer.
Removed the default constructor and the constructors that automatically added a composition target to
CompositionStack.Removed the
kanzi::Renderer3DandRendererparameters from these methods:Removed the
CompositionStackparameter from these methods and all overrides:In
CompositionStack::pushComposition, changed parameter type fromNativeFramebufferHandletoFramebuffer. Code that uses a0for theNativeFramebufferHandlecan now use theCompositionStack::pushCompositionActiveGraphicsOutputto push the framebuffer from theRendereractive graphics output.
In
NodeEffectRenderer2D::endInitialEffectPass, changed the parameter type fromCompositionStacktokanzi::Renderer.
In
CompositionStack::pushRasterization, added parameter typeGraphicsFillMode.
Removed the default stack states from
CompositionStack. It is now required to explicitly push a state before callingCompositionStack::apply.Added the
CompositionStack::pushDefaultSettings2DandCompositionStack::pushDefaultSettings3Dto push default settings. Added theCompositionStack::popSettingsto pop the 2D or 3D settings from the stack.
Removed |
Use instead |
|---|---|
|
|
|
|
|
|
|
|
|
Changes to State Manager¶
Changed how a State Manager sends property change notifications and updates bindings on a state change. Previously every state change sent one notification when removing the properties of the old state, and one notification when adding the properties of the new state. Now a state change sends only one notification with the new property values of the new state. If a state change has a transition animation, during the transition Kanzi sends property notifications as before, but does not send the redundant notifications caused by the state change in the beginning of transition.
When you create a State Manager using the API:
Create the style for the
StateManager::StateObject::setStylewithStyle::createWithValueModifiers.Kanzi modifies the style that it passes to
StateManager::StateObject::setStyleso that the style does not send notifications also when you use it outside of a State Manager.Removed these redundant or broken functions:
Style::createEmptyStyle::copyStyle::copyParentPropertiesStateManager::createEmpty
Changes to properties and bindings¶
String conversions of Boolean values in properties and bindings now result in lower case true or false instead of 1 or 0, and True or False.
To migrate your Kanzi application from an earlier version, make sure that all string values compared against Boolean values are lower case true or false.
Changes to suspension handling¶
Added the WakeupSignalSource class with functionality that replaces these removed functions:
EventSource::getNativeEventHandleKeyMapEventFilter::getNativeEventHandleKeyRepeatGenerator::getNativeEventHandle
Changes to event handling¶
Added the Application::setInputEventHandle function that replaces the functionality removed from Application::appendEventSource.
Changes to kzuEngine¶
Removed the previously deprecated functionality related to kzuEngine:
Application::getEnginefunctionApplication::m_enginememberkzuEnginestructAll functions starting with
kzuEngineThe
kzu_engine.hheader file
Changes to Scroll View messages¶
Removed these deprecated messages and message handlers that were used by the Scroll View and Grid List Box nodes:
Removed |
Use instead |
|---|---|
|
|
|
|
|
Changes to several Kanzi Engine APIs¶
Updated the parameters and return types of several Kanzi Engine APIs to use the size_t data type, instead of the unsigned int.
Changed kanzi::optional and kanzi::string_view to C++17 std implementations. Migrate the parameter and return type of these classes on platforms that used Boost implementation in the previous version of Kanzi.
Changed kanzi::byte to C++17 std implementation. Migrate the parameter and return type of these classes on platforms that used unsigned char in the previous version of Kanzi.
Changes to C wrapper headers¶
Removed the headers kzs_string.hpp, kzs_arg.hpp, and kzs_memory.hpp.
Removed |
Use instead |
|---|---|
and so on |
and so on |
|
|
|
|
|
|
Changes to legacy file API¶
Removed the headers kzs_file.hpp and kzs_resource_file.hpp.
Use ReadOnlyDiskFile instead.
Changes to focus messages¶
Removed these deprecated messages and message handlers that were used by the focus system:
Removed |
Use instead |
|---|---|
|
|
|
Changes to Android NDK version¶
To set your Kanzi application to use the current Android NDK version, in your application build.gradle file set ndkVersion to 26.3.11579264.
Changes to Kanzi Studio Android package export¶
When building an Android package from Kanzi Studio, Kanzi Studio now exports the cfg file based on the project Binary File Name property.
To migrate your application, update the definition of binaryFileName or kzbPathList.
Deprecation of Page and Page Host Nodes¶
The Page and Page Host nodes are deprecated and will be removed in the next version of Kanzi. To create navigable user interfaces, you must manually recreate your Kanzi Studio project and Kanzi applications to use the Activity and Activity Host nodes instead.
To create and inspect Activity Host and Activity nodes, and to simulate Activity activation, use the Activity Browser window. See Using the Activity Browser.
Use these Activity Host nodes to replace the Page Host nodes:
An Exclusive Activity Host can have only one of its child Activities active at a time. When one child Activity of an Exclusive Activity Host is active, all other Activities of that Activity Host are inactive. For example, you can use an Exclusive Activity Host to toggle between views in your application.
Parallel Activity Host can activate more than one of its child Activities at a time. When you activate an Activity, a Parallel Activity Host brings that Activity to the front.
You can use a list data source and a Data-Driven Exclusive Activity Host to create parts of UI with Activities from content of data objects. For example, you can define the content of menus in a data source and use a Data-Driven Exclusive Activity Host to create the menus in your application.
Replace Page nodes with Activity nodes.
To learn about Activities, see:
Changes to text rendering¶
Changed the return type of
FontRuntime::getGlyphCachefromGlyphCachereference toGlyphCacheSharedPtr.GlyphRunnow acceptsGlyphCachein constructor instead ofGlyphRun::drawmethods and exposes its glyph cache texture through theGlyphCache::getTexturemethod.Changed the
TextFormat::drawsignature to accept a render entry and a content texture handle, instead of a material parameter. The function now assumes that the material is already bound in the render state.Removed the previously deprecated
kanzi::StandardMaterial::GlyphTexturePropertyproperty type.FontManager::getRuntimeFontcan now return anullptrinstead of returning an empty font if the font family parameter is empty.
Changes to morph data¶
Previous versions of Kanzi used a separate kanzi::Morph object that inherited Mesh and referred to other meshes as morph targets to blend to and from. Since Kanzi version 4.0.0-beta2 morph data is expressed as differences against the base mesh. The use of multiple meshes have been removed, as has the whole kanzi::Morph class concept.
Meshes may now contain an internal Mesh::MorphData object that contains the differential data. This data can be accessed by const kanzi::Mesh::MorphData* kanzi::Mesh::getMorphData() const. For morphs with sufficiently small amount of shapes that fit the common 16 attribute channel limit, Kanzi Studio will export the mesh data as a vertex buffer blob within Mesh::MorphData. Morph data requiring more channels will be stored as a data texture assigned directly to Model3D based on morph shapes selected for use.
Shaders using old morph fixed uniforms kzMorphDataTexture, kzMorphIndices and kzMorphWeights are now marked deprecated in Studio.
Changes to morph weights¶
In previous versions of Kanzi, when you set a morph mesh for a Model3D node, Kanzi Engine overwrote the morph weights with the default weights from the kanzi::Morph. Since Kanzi 4.0.0-beta1, morph weights are preserved.
To replicate the old behavior, set the Model3D::MeshProperty to nullptr, and assign the new kanzi::Morph.
In previous version of Kanzi, morph weights were handled by a separate morph runtime that was a child object of a kanzi::Model3D node. Since Kanzi 4.0.0-beta1, morph weights are simply a range.
To set morph weights, assign an AbstractRangeSharedPtr that contains a kanzi::TypedValueRange<float> with the correct amount of elements into Model3D::MorphingProperty. The maximum amount of weights can be read from Mesh::MorphData.
Even if no weigths have been assigned, Kanzi Engine creates a class value source filled with the default weights that will be used as long as the application developer has not assigned a higher-level value or binding.
The previus mechanism for animating morph weights using kanzi::MorphWeightAnimationTimeline has been deprecated. Since the morph weights are now simply a range property, use the newly introduced type RangeIndexAnimationTimeline.
Removed |
Use instead |
|---|---|
|
|
|
Changes to CubeMapRenderPass¶
CubeMapRenderPass no longer automatically creates a depth texture. To create a depth texture, set the CubeMapRenderPass::DepthFormatProperty.
Unless you set CubeMapRenderPass::DepthFormatProperty, or you manually set a depth texture using the CubeMapRenderPass::DepthTargetProperty, to save memory and improve performance, Kanzi uses only one depth renderbuffer. Kanzi reuses this depth renderbuffer for each face in the CubeMapRenderPass.
Changes to Texture¶
The obsolete create info types kanzi::Texture::CreateInfoNode2DRenderTarget and Texture::CreateInfoRenderpassRenderTarget have been removed. Use Texture::CreateInfoRenderTarget. Textures used for composition now always either contain their own framebuffers, or are internally combined by Kanzi into a single framebuffer, for example in CompositionTargetRenderPass. The specific separate creation scenarios are removed as unnecessary.
Changes to Kanzi Studio commands¶
Changed
SaveProjectto accept directory path instead of file path. ReplaceSaveProject "C:\Example\directory\path\projectName.kzproj"withSaveProject "C:\example\directory\path\", or alternatively with SaveProject to save the project to its existing location. See SaveProject.Changed
NewProjectto accept directory path instead of file path. ReplaceNewProject "C:\Example\directory\path\projectName.kzproj"withNewProject "C:\example\directory\path\" "projectName". See NewProject.
Removed API members¶
Removed these Kanzi Engine C++ API members that were deprecated in earlier versions of Kanzi:
Removed |
Use instead |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Not available |
|
|
|
|
|