SimpleGL  1.1.0
A framework for platform independent rendering
Public Member Functions | Static Public Member Functions | List of all members
sgl::VulkanContext Class Reference

This class contains all relevant Vulkan objects to setup a Vulkan application. More...

#include <vulkan_context.hpp>

Public Member Functions

 VulkanContext (void)
 Creates a new Vulkan context. More...
 
 ~VulkanContext (void)
 Destroys the Vulkan context. More...
 
InstancegetInstance ()
 Returns the Vulkan instance of this context. More...
 
DebugReportCallbackgetDebugReportCallback ()
 Returns the debug report callback of this context. More...
 
std::vector< PhysicalDevice * > getAvailablePhysicalDevices ()
 Returns the available physical devices of this context. More...
 
PhysicalDevicegetPhysicalDevice ()
 Returns the physical device of this context. More...
 
DevicegetDevice ()
 Returns the logical device of this context. More...
 
SwapchaingetSwapchain ()
 Returns the swapchain of this context. More...
 
uint32_t getSwapchainCount ()
 Returns the number of swapchain images. More...
 
uint32_t getSwapchainIndex ()
 Returns the current swapchain image index. More...
 
FramebufferVKgetSwapchainFramebuffer ()
 Returns the current swapchain framebuffers of this context. More...
 
CommandPoolgetCommandPool ()
 Returns the command pool of this context. More...
 
DescriptorPoolgetDescriptorPool ()
 Returns the descriptor pool of this context. More...
 
FencegetRenderFence ()
 Returns the current fence for signaling that a command buffer has finished rendering. More...
 
void setupDebugCallback ()
 Creates a debug report callback, if compiled in debug mode. More...
 
void pickPhysicalDevice (Surface *surface)
 Enumerates all available physical devices and picks a suitable physical device. More...
 
void createLogicalDevice ()
 Creates the logical device for rendering. More...
 
void createSwapchain (Surface *surface, glm::ivec2 size)
 Creates a swapchain for this context. More...
 
void createFramebuffers (RenderPass *renderPass)
 Creates the swapchain framebuffers for this context. More...
 
void createCommandPool ()
 Creates the command pool for this context. More...
 
void createDescriptorPool ()
 Create the descriptor pool for this context. More...
 
void createRenderFence ()
 Creates the render fence. More...
 

Static Public Member Functions

static VulkanContextgetCurrent ()
 Returns the current Vulkan context. More...
 
static void setCurrent (VulkanContext *context)
 Sets the current Vulkan context. More...
 

Detailed Description

This class contains all relevant Vulkan objects to setup a Vulkan application.

Definition at line 36 of file vulkan_context.hpp.

Constructor & Destructor Documentation

sgl::VulkanContext::VulkanContext ( void  )

Creates a new Vulkan context.

Definition at line 31 of file vulkan_context.cpp.

sgl::VulkanContext::~VulkanContext ( void  )

Destroys the Vulkan context.

Definition at line 36 of file vulkan_context.cpp.

Member Function Documentation

void sgl::VulkanContext::createCommandPool ( )

Creates the command pool for this context.

Definition at line 156 of file vulkan_context.cpp.

void sgl::VulkanContext::createDescriptorPool ( )

Create the descriptor pool for this context.

Definition at line 161 of file vulkan_context.cpp.

void sgl::VulkanContext::createFramebuffers ( RenderPass renderPass)

Creates the swapchain framebuffers for this context.

Parameters
renderPassThe render pass to use.

Definition at line 146 of file vulkan_context.cpp.

void sgl::VulkanContext::createLogicalDevice ( )

Creates the logical device for rendering.

Definition at line 136 of file vulkan_context.cpp.

void sgl::VulkanContext::createRenderFence ( )

Creates the render fence.

Definition at line 166 of file vulkan_context.cpp.

void sgl::VulkanContext::createSwapchain ( Surface surface,
glm::ivec2  size 
)

Creates a swapchain for this context.

Parameters
surfaceThe surface for the swapchain.
sizeThe window size.

Definition at line 141 of file vulkan_context.cpp.

std::vector< PhysicalDevice * > sgl::VulkanContext::getAvailablePhysicalDevices ( )

Returns the available physical devices of this context.

Returns
The available physical devices of this context.

Definition at line 80 of file vulkan_context.cpp.

CommandPool * sgl::VulkanContext::getCommandPool ( )

Returns the command pool of this context.

Returns
The command pool of this context.

Definition at line 108 of file vulkan_context.cpp.

VulkanContext * sgl::VulkanContext::getCurrent ( )
static

Returns the current Vulkan context.

Returns
The current Vulkan context.

Definition at line 20 of file vulkan_context.cpp.

DebugReportCallback * sgl::VulkanContext::getDebugReportCallback ( )

Returns the debug report callback of this context.

Returns
The debug report callback of this context.

Definition at line 76 of file vulkan_context.cpp.

DescriptorPool * sgl::VulkanContext::getDescriptorPool ( )

Returns the descriptor pool of this context.

Returns
The descriptor pool of this context.

Definition at line 112 of file vulkan_context.cpp.

Device * sgl::VulkanContext::getDevice ( )

Returns the logical device of this context.

Returns
The logical device of this context.

Definition at line 88 of file vulkan_context.cpp.

Instance * sgl::VulkanContext::getInstance ( )

Returns the Vulkan instance of this context.

Returns
The Vulkan instance of this context.

Definition at line 72 of file vulkan_context.cpp.

PhysicalDevice * sgl::VulkanContext::getPhysicalDevice ( )

Returns the physical device of this context.

Returns
The physical device of this context.

Definition at line 84 of file vulkan_context.cpp.

Fence * sgl::VulkanContext::getRenderFence ( )

Returns the current fence for signaling that a command buffer has finished rendering.

Returns
The current fence for signaling that a command buffer has finished rendering.

Definition at line 116 of file vulkan_context.cpp.

Swapchain * sgl::VulkanContext::getSwapchain ( )

Returns the swapchain of this context.

Returns
The swapchain of this context.

Definition at line 92 of file vulkan_context.cpp.

uint32_t sgl::VulkanContext::getSwapchainCount ( )

Returns the number of swapchain images.

Returns
The number of swapchain images.

Definition at line 96 of file vulkan_context.cpp.

FramebufferVK * sgl::VulkanContext::getSwapchainFramebuffer ( )

Returns the current swapchain framebuffers of this context.

Returns
The current swapchain framebuffers of this context.

Definition at line 104 of file vulkan_context.cpp.

uint32_t sgl::VulkanContext::getSwapchainIndex ( )

Returns the current swapchain image index.

Returns
The current swapchain image index.

Definition at line 100 of file vulkan_context.cpp.

void sgl::VulkanContext::pickPhysicalDevice ( Surface surface)

Enumerates all available physical devices and picks a suitable physical device.

Parameters
surfaceThe window surface for checking swapchain support.

Definition at line 130 of file vulkan_context.cpp.

void sgl::VulkanContext::setCurrent ( VulkanContext context)
static

Sets the current Vulkan context.

Parameters
contextThe Vulkan context to set.

Definition at line 24 of file vulkan_context.cpp.

void sgl::VulkanContext::setupDebugCallback ( )

Creates a debug report callback, if compiled in debug mode.

Definition at line 120 of file vulkan_context.cpp.


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