ISwapchain::getFormat - dpw105f18/papago-api GitHub Wiki

Get the format of the Swapchain

uint32_t getFormat()

Returns

Returns the format of swapchain image.

Example

#include "isurface.hpp"
#include "idevice.hpp"
#include "api_enums.hpp"
#include "iswapchain.hpp"

int main()
{
   /*
   setup code omitted
   */ 

   //Create a SwapChain
   auto swapChain = device->createSwapChain(Format::eR8G8B8A8Unorm, Format::eD32Sfloat, 3, IDevice::PresentMode::eMailbox);
   
   //Get the format of the swapchain. This is used when creating creating a renderpass.
   auto swapchainFormat = swapChain->getFormat();
}