FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
fge::vulkan::Instance Class Reference

Vulkan instance abstraction. More...

#include <C_instance.hpp>

Public Member Functions

 Instance (std::string_view applicationName, uint16_t versionMajor=1, uint16_t versionMinor=0, uint16_t versionPatch=0)
 
 Instance (Instance const &r)=delete
 
 Instance (Instance &&r) noexcept
 
Instanceoperator= (Instance const &r)=delete
 
Instanceoperator= (Instance &&r) noexcept=delete
 
void create (std::string_view applicationName, uint16_t versionMajor=1, uint16_t versionMinor=0, uint16_t versionPatch=0)
 Create the instance.
 
void destroy ()
 
tiny_utf8::string const & getApplicationName () const
 
VkInstance get () const
 
std::vector< PhysicalDevice > const & getPhysicalDevices () const
 Get a list of physical devices.
 
std::optional< PhysicalDevicepickPhysicalDevice (VkSurfaceKHR surface) const
 Pick a physical device.
 

Detailed Description

Vulkan instance abstraction.

This class is used to create a Vulkan instance and get the physical devices.

Constructor & Destructor Documentation

◆ Instance()

fge::vulkan::Instance::Instance ( std::string_view applicationName,
uint16_t versionMajor = 1,
uint16_t versionMinor = 0,
uint16_t versionPatch = 0 )
explicit
See also
create()

Member Function Documentation

◆ create()

void fge::vulkan::Instance::create ( std::string_view applicationName,
uint16_t versionMajor = 1,
uint16_t versionMinor = 0,
uint16_t versionPatch = 0 )

Create the instance.

Parameters
applicationNameThe application name
versionMajorThe application version major
versionMinorThe application version minor
versionPatchThe application version patch

◆ getPhysicalDevices()

std::vector< PhysicalDevice > const & fge::vulkan::Instance::getPhysicalDevices ( ) const
nodiscard

Get a list of physical devices.

You have to create the instance before calling this function.

Returns
The list of physical devices

◆ pickPhysicalDevice()

std::optional< PhysicalDevice > fge::vulkan::Instance::pickPhysicalDevice ( VkSurfaceKHR surface) const
nodiscard

Pick a physical device.

Pick a physical device that support the surface based on a score. It will prioritize discrete GPU over integrated GPU.

Parameters
surfaceThe surface
Returns
The physical device or VK_NULL_HANDLE if no physical device is found

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