On some (especially mobile) devices, images can be viewed from different orientations. Sometimes we would like to be able to specify how an image should be oriented when it is displayed on screen. In Vulkan, we have such a possibility. When creating a swapchain, we need to specify the transformation which should be applied to an image before it is presented.
Selecting a transformation of swapchain images
How to do it...
- Acquire the capabilities of a presentation surface (refer to the Getting capabilities of a presentation surface recipe). Store them in a variable of type VkSurfaceCapabilitiesKHR named surface_capabilities.
- Store the desired transformations in a bit field variable of type VkSurfaceTransformFlagBitsKHR named desired_transform.
- Create a variable of...