SimpleGL
1.1.0
A framework for platform independent rendering
|
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... | |
Instance * | getInstance () |
Returns the Vulkan instance of this context. More... | |
DebugReportCallback * | getDebugReportCallback () |
Returns the debug report callback of this context. More... | |
std::vector< PhysicalDevice * > | getAvailablePhysicalDevices () |
Returns the available physical devices of this context. More... | |
PhysicalDevice * | getPhysicalDevice () |
Returns the physical device of this context. More... | |
Device * | getDevice () |
Returns the logical device of this context. More... | |
Swapchain * | getSwapchain () |
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... | |
FramebufferVK * | getSwapchainFramebuffer () |
Returns the current swapchain framebuffers of this context. More... | |
CommandPool * | getCommandPool () |
Returns the command pool of this context. More... | |
DescriptorPool * | getDescriptorPool () |
Returns the descriptor pool of this context. More... | |
Fence * | getRenderFence () |
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 VulkanContext * | getCurrent () |
Returns the current Vulkan context. More... | |
static void | setCurrent (VulkanContext *context) |
Sets the current Vulkan context. More... | |
This class contains all relevant Vulkan objects to setup a Vulkan application.
Definition at line 36 of file vulkan_context.hpp.
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.
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.
renderPass | The 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.
surface | The surface for the swapchain. |
size | The 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.
Definition at line 80 of file vulkan_context.cpp.
CommandPool * sgl::VulkanContext::getCommandPool | ( | ) |
Returns the command pool of this context.
Definition at line 108 of file vulkan_context.cpp.
|
static |
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.
Definition at line 76 of file vulkan_context.cpp.
DescriptorPool * sgl::VulkanContext::getDescriptorPool | ( | ) |
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.
Definition at line 88 of file vulkan_context.cpp.
Instance * sgl::VulkanContext::getInstance | ( | ) |
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.
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.
Definition at line 116 of file vulkan_context.cpp.
Swapchain * sgl::VulkanContext::getSwapchain | ( | ) |
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.
Definition at line 96 of file vulkan_context.cpp.
FramebufferVK * sgl::VulkanContext::getSwapchainFramebuffer | ( | ) |
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.
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.
surface | The window surface for checking swapchain support. |
Definition at line 130 of file vulkan_context.cpp.
|
static |
Sets the current Vulkan context.
context | The 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.