Mandrill 2025.6.0
Loading...
Searching...
No Matches
Mandrill::Device Class Reference

Device class abstracting the physical and logical Vulkan device, as well as handling extensions and features. More...

#include <Device.h>

Public Member Functions

MANDRILL_API Device (GLFWwindow *pWindow, const std::vector< const char * > &extensions=std::vector< const char * >(), VkPhysicalDeviceFeatures2 *pFeatures=nullptr, uint32_t physicalDeviceIndex=0)
 Device that abstracts the physical and logical device, and their features and properties.
 
MANDRILL_API ~Device ()
 Destructor for device.
 
MANDRILL_API VkDevice getDevice () const
 Get Vulkan device handle.
 
MANDRILL_API VkInstance getInstance () const
 Get Vulkan instance handle.
 
MANDRILL_API VkPhysicalDevice getPhysicalDevice () const
 Get Vulkan physical device handle.
 
MANDRILL_API DeviceProperties getProperties () const
 Get device and physical device properties.
 
MANDRILL_API GLFWwindow * getWindow () const
 Get the window that the device is bound to.
 
MANDRILL_API VkSurfaceKHR getSurface () const
 Get the presentation surface of the application.
 
MANDRILL_API VkCommandPool getCommandPool () const
 Get the command pool.
 
MANDRILL_API VkQueue getQueue () const
 Get the queue.
 
MANDRILL_API uint32_t getQueueFamily () const
 Get the queue family.
 
MANDRILL_API bool supportsRayTracing () const
 Check if the given context supports ray tracing.
 
MANDRILL_API bool getVsync () const
 Get the current verical sync mode.
 
MANDRILL_API void setVsync (bool vsync)
 Set a vertical sync mode.
 
MANDRILL_API VkSampleCountFlagBits getSampleCount () const
 Get the multisample anti-aliasing sample count.
 

Detailed Description

Device class abstracting the physical and logical Vulkan device, as well as handling extensions and features.

Constructor & Destructor Documentation

◆ Device()

Device::Device ( GLFWwindow *  pWindow,
const std::vector< const char * > &  extensions = std::vector<const char*>(),
VkPhysicalDeviceFeatures2 *  pFeatures = nullptr,
uint32_t  physicalDeviceIndex = 0 
)

Device that abstracts the physical and logical device, and their features and properties.

Parameters
windowGLFW window to create render context for
extensionsExtra device extensions to activate
pFeaturesPointer to a pNext-chain of features to link with when creating device, can be nullptr in which case a set of required default features will be used
physicalDeviceIndexPhysical device to use. Set this explicitly if device 0 is not the intended one.

Member Function Documentation

◆ getCommandPool()

MANDRILL_API VkCommandPool Mandrill::Device::getCommandPool ( ) const
inline

Get the command pool.

Returns
A Vulkan command pool handle

◆ getDevice()

MANDRILL_API VkDevice Mandrill::Device::getDevice ( ) const
inline

Get Vulkan device handle.

Returns
Vulkan device handle

◆ getInstance()

MANDRILL_API VkInstance Mandrill::Device::getInstance ( ) const
inline

Get Vulkan instance handle.

Returns
Vulkan instance handle

◆ getPhysicalDevice()

MANDRILL_API VkPhysicalDevice Mandrill::Device::getPhysicalDevice ( ) const
inline

Get Vulkan physical device handle.

Returns
Vulkan physical device handle

◆ getProperties()

MANDRILL_API DeviceProperties Mandrill::Device::getProperties ( ) const
inline

Get device and physical device properties.

Returns
DeviceProperties struct containing properties

◆ getQueue()

MANDRILL_API VkQueue Mandrill::Device::getQueue ( ) const
inline

Get the queue.

Returns
A Vulkan queue handle

◆ getQueueFamily()

MANDRILL_API uint32_t Mandrill::Device::getQueueFamily ( ) const
inline

Get the queue family.

Returns
A Vulkan queue family handle

◆ getSampleCount()

VkSampleCountFlagBits Device::getSampleCount ( ) const

Get the multisample anti-aliasing sample count.

Returns
Sample count

◆ getSurface()

MANDRILL_API VkSurfaceKHR Mandrill::Device::getSurface ( ) const
inline

Get the presentation surface of the application.

Returns
The current VkSurfaceKHR

◆ getVsync()

MANDRILL_API bool Mandrill::Device::getVsync ( ) const
inline

Get the current verical sync mode.

Returns
True if vertical sync is activated, otherwise false.

◆ getWindow()

MANDRILL_API GLFWwindow * Mandrill::Device::getWindow ( ) const
inline

Get the window that the device is bound to.

Returns
A GLFWwindow pointer

◆ setVsync()

MANDRILL_API void Mandrill::Device::setVsync ( bool  vsync)
inline

Set a vertical sync mode.

Parameters
vsyncTrue if vertical sync should be on, otherwise false.
Returns

◆ supportsRayTracing()

MANDRILL_API bool Mandrill::Device::supportsRayTracing ( ) const
inline

Check if the given context supports ray tracing.

Returns
True if ray tracing is supported, otherwise false.

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