Vulkan SDK for Android 1.1.1 Mali Developer Center
MaliSDK::VulkanApplication Class Referenceabstract

VulkanApplication is inherited by all samples. The common platform code will run the main loop and take care of application lifecycle. More...

#include <application.hpp>

Public Member Functions

virtual ~VulkanApplication ()=default
 Destructor.
 
virtual bool initialize (Context *pContext)=0
 This function is called when the context is brought up and is the constructor of this class. More...
 
virtual void updateSwapchain (const std::vector< VkImage > &backbuffers, const Platform::SwapchainDimensions &dimensions)=0
 Called when the swapchain has been initialized. More...
 
virtual void render (unsigned swapchainIndex, float deltaTime)=0
 Render a frame. More...
 
virtual void terminate ()=0
 Destructor for the class. More...
 

Detailed Description

VulkanApplication is inherited by all samples. The common platform code will run the main loop and take care of application lifecycle.

Definition at line 33 of file application.hpp.

Member Function Documentation

◆ initialize()

virtual bool MaliSDK::VulkanApplication::initialize ( Context pContext)
pure virtual

This function is called when the context is brought up and is the constructor of this class.

Parameters
pContextThe Vulkan context
Returns
true if initialization succeeded. If initialization fails, the application will terminate.

◆ render()

virtual void MaliSDK::VulkanApplication::render ( unsigned  swapchainIndex,
float  deltaTime 
)
pure virtual

Render a frame.

Parameters
swapchainIndexThe swapchain index to render into, previously obtained by backbuffers parameter in updateSwapchain.
deltaTimeThe time in seconds since last call to render.

◆ terminate()

virtual void MaliSDK::VulkanApplication::terminate ( )
pure virtual

Destructor for the class.

After this call returns, initialize can be called again.

◆ updateSwapchain()

virtual void MaliSDK::VulkanApplication::updateSwapchain ( const std::vector< VkImage > &  backbuffers,
const Platform::SwapchainDimensions dimensions 
)
pure virtual

Called when the swapchain has been initialized.

updateSwapchain is always called after the first initialize.

If the swapchain for some reason is lost or recreated, this can be called several times during the lifetime of the application.

Parameters
backbuffersA vector containing all the backbuffers in the current swapchain
dimensionsThe dimensions of the swapchain, along with the VkFormat needed to create render passes

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