Kanzi 3.2 migration guide

Kanzi 3.2 migration guide contains information and provides instructions for porting existing Kanzi applications from the previous Kanzi release:

Kanzi Studio changes

Default texture

When you migrate Kanzi Studio projects that use the default texture from Kanzi Studio 3.1.1 to Kanzi Studio 3.2, Kanzi Studio creates the Default Texture Single Texture and DefaultBackgroundImage.png image that the Default Texture uses.

Kanzi Engine changes

OpenGL wrapper functions kzsGl*() are now implemented as non-inline functions.

In Kanzi 3.2, the default swap behavior is changed from copy to swap. This means that rendering a new frame starts from empty instead of what previous frame rendered. See KzsSurfaceProperties.

If you want to use copy, in your Application class use:

virtual void onConfigure(ApplicationProperties& configuration) KZ_OVERRIDE
{
    <base class>::onConfigure(configuration);
    configuration.defaultSurfaceProperties.swapBehaviorCopy = 1;
}

Kanzi namespace includes C++ features from the std namespace

Kanzi namespace includes C++ features from the std namespace, such as shared_ptr, vector and string. For example, include <kanzi/platform/vector.hpp> instead of <vector>.

Mesh changes

Primitive meshes (Box, Sphere, Plane) use half-float vertex data type when the target hardware supports it.

Kanzi 3.1.1

Kanzi 3.2

PrimitiveType

GraphicsPrimitiveType

MeshVertexAttribute

VertexAttribute

MeshVertexAttributeDataType

GraphicsDataType

MeshVertexAttributeDataType::FLOAT32

GraphicsDataTypeSFLOAT32

MeshVertexAttributeSemantic::Value

VertexAttribute::Semantic

MeshVertexAttributeSemantic::POSITION

VertexAttribute::SemanticPosition

Renderer changes

kzcRenderer is now kanzi::Renderer:

  • Header core/renderer/kzc_renderer.h is replaced by kanzi/rendering/renderer.hpp.

  • Header core/renderer/kzc_gpu_buffer_manager.h is replaced by kanzi/rendering/gpu_buffer_manager.hpp.

  • Header core/util/image/kzc_etc.h is replaces by user/image/kzc_etc.h

  • struct kzcRenderer is replaced by Renderer.

Kanzi 3.1.1 function

Kanzi 3.2 function

kzcRendererGetGPUBufferManager()

Renderer::getGPUBufferManager()

kzcRendererGenerateBuffer()

Renderer::generateBuffer()

kzcRendererDeleteBuffer()

Renderer::deleteBuffer()

kzcRendererSetVertexBuffer()

Renderer::setVertexBuffer()

kzcRendererSetVertexBufferData()

Renderer::setVertexBufferData()

kzcRendererEnableVertexAttributeArray()

Renderer::enableVertexAttributeArray() Renderer::disableVertexAttributeArray()

kzcRendererSetVertexBufferPointer()

Renderer::setVertexBufferPointer()

kzcRendererSetIndexBuffer()

Renderer::setIndexBuffer()

kzcRendererSetIndexBufferData()

Renderer::setIndexBufferData()

kzcRendererSetIndexData()

Renderer::setIndexData()

kzcRendererSetIndexCount()

Renderer::setIndexCount()

kzcRendererSetPrimitiveType()

Renderer::setPrimitiveType()

kzcRendererGenerateFrameBuffer()

Renderer::generateFramebuffer()

kzcRendererBindFrameBuffer()

Renderer::bindFramebuffer()

kzcRendererIsFrameBufferComplete()

Renderer::isFramebufferComplete()

kzcRendererDeleteFrameBuffer()

Renderer::deleteFramebuffer()

kzcRendererSetActiveFrameBuffer()

Renderer::setActiveFramebuffer()

kzcRendererResetActiveFrameBuffer()

Renderer::resetActiveFramebuffer()

kzcRendererFrameBufferRenderBuffer()

Renderer::framebufferRenderbuffer()

kzcRendererFrameBufferTexture2D()

Renderer::framebufferTexture2D()

kzcRendererGenerateRenderBuffer()

Renderer::generateRenderbuffer()

kzcRendererBindRenderBuffer()

Renderer::bindRenderbuffer()

kzcRendererRenderBufferStorage()

Renderer::renderbufferStorage()

kzcRendererDeleteRenderBuffer()

Renderer::deleteRenderbuffer()

kzcRendererIsClearEnabled()

Renderer::isClearEnabled()

kzcRendererCreateShader()

Renderer::createShader()

kzcRendererCompileSourceShader()

Renderer::compileSourceShader()

kzcRendererDeployBinaryShader()

Renderer::deployBinaryShader()

kzcRendererCreateShaderProgram()

Renderer::createShaderProgram()

kzcRendererAttachShaderToProgram()

Renderer::attachShaderToProgram()

kzcRendererBindAttributeToLocation()

Renderer::bindAttributeToLocation()

kzcRendererLinkShader()

Renderer::linkShader()

kzcRendererProgramBinary()

Renderer::programBinary()

kzcRendererDeleteShader()

Renderer::deleteShader()

kzcRendererSetActiveVertexAttributeMap()

Renderer::setActiveShaderHandle()

kzcRendererSetVertexCount()

Renderer::setVertexCount()

kzcRendererEnableState()

Renderer::enableState()

kzcRendererDisableState()

Renderer::disableState()

kzcRendererGetState()

Renderer::getState()

kzcRendererSetClearColor()

Renderer::setClearColor()

kzcRendererSetClearDepthValue()

Renderer::setClearDepthValue()

kzcRendererSetClearStencil()

Renderer::setClearStencil()

kzcRendererSetColorWriteMode()

Renderer::setColorWriteMode()

kzcRendererSetViewport()

Renderer::setViewport()

kzcRendererSetScissorTest()

Renderer::setScissorTest()

kzcRendererSetDepthTest()

Renderer::setDepthTest()

kzcRendererSetMatrix()

Renderer::setMatrix()

kzuRendererApplyCameraMatrix()

Renderer::applyCameraMatrix()

kzuRendererApplyLight()

Renderer::applyLight()

kzcRendererResetClearTarget()

Renderer::resetClearTarget()

kzcRendererGetUniformLocation()

Renderer::getUniformArrayLength()

kzcRendererGetUniformTexture()

Renderer::getUniformTexture()

kzcRendererSetUniformVecArray()

Renderer::setUniformVecArray()

kzcRendererGenerateTexture()

Renderer::generateTexture()

kzcRendererBindTexture()

Renderer::bindTexture()

kzcRendererSetTextureFilter()

Renderer::setTextureFilter()

kzcRendererSetTextureAddressingMode()

Renderer::setTextureAddressingMode()

kzcRendererSetTextureImage2D()

Renderer::setTextureImage2D()

kzcRendererSetCompressedTextureImage2D()

Renderer::setCompressedTextureImage2D()

kzcRendererSetTextureSubImage2D()

Renderer::setTextureSubImage2D()

kzcRendererApplyTexture()

Renderer::applyTexture()

kzcRendererGenerateMipmap()

Renderer::generateMipmap()

kzcRendererDeleteTexture()

Renderer::deleteTexture()

kzcRendererGetMaximumTextureSize()

Renderer::getMaximumTextureSize()

kzcRendererGetMaximumRenderbufferSize()

Renderer::getMaximumRenderbufferSize()

kzcRendererGetMaximumViewportWidth()

Renderer::getMaximumViewportWidth()

kzcRendererGetMaximumViewportHeight()

Renderer::getMaximumViewportHeight()

kzuRendererResetPass()

Renderer3D::resetPass()

kzuRendererSetOverrideMaterial()

Renderer3D::setOverrideMaterial()

kzuRendererSetTransformedObjectList()

Renderer3D::setTransformedObjectList()

kzuRendererSetSortByShader()

Renderer3D::setSortByShader()

kzuRendererIsSortByShader()

Renderer3D::isSortByShader()

kzuRendererResolveBatchQueue()

Renderer3D::resolveBatchQueue()

kzuRendererGetClearColorBufferOverride()

Renderer3D::getClearColorBufferOverride()

kzuRendererGetClearColorOverride()

Renderer3D::getClearColorOverride()

kzuRendererGetCullFaceOverride()

Renderer3D::getCullFaceOverride()

kzuRendererApplyStencilSettings()

Renderer3D::applyStencilSettings()

kzuRendererDrawPrimitiveBufferTextured()

Renderer3D::drawPrimitiveBufferTextured()

kzuRendererGetPropertyQuery()

Renderer3D::getPropertyQuery()

Kanzi 3.1.1 enum

Kanzi 3.2 enum

KzcRendererClearTarget

GraphicsClearTarget

KzcRendererBlendMode

GraphicsBlendMode

KzcRendererDepthTest

GraphicsCompareFunction

KzcRendererState

Renderer::State

KzcRendererMatrix

Renderer::FixedMatrix

KzcRendererCullMode

GraphicsCullMode

KzcRendererStencilFunction

GraphicsCompareFunction

KzcRendererStencilOperation

GraphicsStencilOperation

Renderer3D changes

kzuRenderer is now kanzi::Renderer3D:

  • Headers user/renderer/kzu_renderer.h and user/renderer/kzu_renderer_util.h are replaced by kanzi/graphics_3d/renderer3d.hpp.

  • struct kzuRenderer is replaced by Renderer3D.

KzuTransformedScene is replaced by TransformedScene3D.

Kanzi 3.1.1 function

Kanzi 3.2 function

kzuRendererResetPass()

Renderer3D::resetPass()

kzuRendererSetOverrideMaterial()

Renderer3D::setOverrideMaterial()

kzuRendererSetTransformedObjectList()

Renderer3D::setTransformedObjectList()

kzuRendererSetSortByShader()

Renderer3D::setSortByShader()

kzuRendererIsSortByShader()

Renderer3D::isSortByShader()

kzuRendererResolveBatchQueue()

Renderer3D::resolveBatchQueue()

kzuRendererGetClearColorBufferOverride()

Renderer3D::getClearColorBufferOverride()

kzuRendererGetClearColorOverride()

Renderer3D::getClearColorOverride()

kzuRendererGetCullFaceOverride()

Renderer3D::getCullFaceOverride()

kzuRendererApplyStencilSettings()

Renderer3D::applyStencilSettings()

kzuRendererDrawPrimitiveBufferTextured()

Renderer3D::drawPrimitiveBufferTextured()

kzuRendererGetPropertyQuery()

Renderer3D::getPropertyQuery()

Kanzi 3.1.1 enum

Kanzi 3.2 enum

KzuCullMode

GraphicsCullMode

KzuColorWriteMode

GraphicsColorWriteMode

KzuStencilOperation

GraphicsStencilOperation

KzuStencilFunction

GraphicsCompareFunction

Resources

Kanzi 3.1.1 function

Kanzi 3.2 function

kzuResourceLoad()

Resource::load()

kzuResourceIsLoaded()

Resource::isLoaded()

GPU resources

Kanzi 3.1.1 function

Kanzi 3.2 function

GPUResource::getDeploymentStrategy()

GPUResource::getDeployOnLoad()

GPUResource::setDeploymentStrategy()

GPUResource::setDeployOnLoad()

Framebuffer

If the requested format is not supported these functions try to use a fallback texture format:

  • Framebuffer::addTexture()

  • Framebuffer::addRenderbuffer()

Kanzi 3.1.1 enum

Kanzi 3.2 enum

FramebufferAttachment

Framebuffer::Attachment

APIFramebufferAttachment

Surface::APIAttachment

Texture

Kanzi 3.1.1 enum

Kanzi 3.2 enum

TextureTarget::Value

Texture::Target

TextureFlag::Value

Texture::CreateFlags

TextureFilter

Sampler::Filter

TextureMipmapMode

Sampler::MipmapMode

TextureAddressingMode

Sampler::AddressingMode

Shader

Kanzi 3.1.1 enum

Kanzi 3.2 enum

ShaderType::Value

Shader::ProgramType