Core module

The Core group handles the base Vulkan resources and objects: LogicalDevice, PhysicalDevice, Instance, and Window.

Contents

It also includes the InputHandler class, which is responsible for handling input events and updats from the Window class.

Classes

struct vpr::VprExtensionPack
The VprExtensionPack structure makes requesting extensions in the device and instance constructors easier and more robust, by allowing the specification of required and optional extensions.
class vpr::Instance
Instance is a wrapper around the base Vulkan object that must be initialized first.
struct vpr::vkQueueFamilyIndices
Simple wrapper struct for storing queue family indices.
class vpr::Device
!The Device class is a wrapper around the vkLogicalDevice object.
class vpr::PhysicalDevice
! PhysicalDevice is a wrapper around a VkPhysicalDevice object, which is itself merely a handle representing a Vulkan-compatible hardware device in a user's system.
class vpr::SurfaceKHR
The bare-minimum required to wrap a VkSurfaceKHR object.
class vpr::Swapchain
This class abstracts away much of the detailed work and boilerplate code required to setup a swapchain in Vulkan.
struct vpr::VkDebugUtilsFunctions
This structure will be populated with function pointers used to call the functions (as named) when available, or requested.
struct vpr::SwapchainImpl::SwapchainInfo
SwapchainInfo takes care of hiding away much of the setup work required to create a swapchain.

Enums

enum class vertical_sync_mode: uint32_t { None = 0, VerticalSync = 1, VerticalSyncRelaxed = 2, VerticalSyncMailbox = 3, SharedDemandRefresh = 4, SharedContinuousRefresh = 5 }
Used to select which of the presentation modes are to be used by a Swapchain.

Functions

auto SetLoggingRepository_VprCore(void* logging_repo) -> VPR_API void
Pass an easyloggingpp logging repository pointer into this function, and it will be set as the repository for this module to use.
auto RecreateSwapchainAndSurface(Swapchain* swap, SurfaceKHR* surface) -> void VPR_API
Pass a swapchain and surface pointer to this to have the swapchain and surface destroyed and recreated in the proper order.

Enum documentation

enum class vertical_sync_mode: uint32_t

Used to select which of the presentation modes are to be used by a Swapchain.

Consult Vulkan docs for more info on presentation modes. Currently missing shared presentation modes for the mobile-specific swapchain extensions for better presentation.

Enumerators
None

Aliases to immediate present mode.

No buffering, high incidences of tearing.

VerticalSync

Aliases to simple FIFO mode - vertical sync and double-buffering, effectively.

VerticalSyncRelaxed

Aliases to relaxed FIFO mode - if a frame is missed, tearing is allowed.

Efficient and most effective on mobile platforms.

VerticalSyncMailbox

Aliases to Vulkan's mailbox mode, which effectively becomes triple-buffering.

SharedDemandRefresh

Aliases to demand-refresh shared mode.

Application may refresh as it wishes, but will also guarantee that it refreshes on a call to present.

SharedContinuousRefresh

Alias to the continued-refresh mode.

Swapchain will continously refresh the contents of the screen as it sees fit, and makes no guarantee of a refresh upon a call to present.

Function documentation

VPR_API void SetLoggingRepository_VprCore(void* logging_repo)

Pass an easyloggingpp logging repository pointer into this function, and it will be set as the repository for this module to use.

That way, all log messages from all modules (even when using this as a shared library) will go to the same sinks

void VPR_API RecreateSwapchainAndSurface(Swapchain* swap, SurfaceKHR* surface)

Pass a swapchain and surface pointer to this to have the swapchain and surface destroyed and recreated in the proper order.

If done incorrectly, the validation layers will give you errors about a surface being destroyed before it's swapchain is (in the best case), or crash in the worst case