18 VulkanContext* VulkanContext::current =
nullptr;
26 if (context !=
nullptr) {
44 delete descriptorPool;
51 delete swapchainFramebuffers[i];
61 delete debugReportCallback;
67 if (VulkanContext::current ==
this) {
68 VulkanContext::current =
nullptr;
77 return debugReportCallback;
81 return availablePhysicalDevices;
85 return physicalDevice;
113 return descriptorPool;
126 debugReportCallback =
nullptr;
143 swapchain =
new Swapchain(surface, size);
168 renderFence =
new Fence();
This class wraps a Vulkan instance.
This class wraps a Vulkan descriptor pool.
static void setCurrent(DebugReportCallback *callback)
Sets the current debug report callback.
Device * getDevice()
Returns the logical device of this context.
std::vector< VkImage > images
The available swapchain images.
std::vector< PhysicalDevice * > getAvailablePhysicalDevices()
Returns the available physical devices of this context.
This class wraps a Vulkan physical device and represents a graphics card.
Swapchain * getSwapchain()
Returns the swapchain of this context.
static VulkanContext * getCurrent()
Returns the current Vulkan context.
PhysicalDevice * getPhysicalDevice()
Returns the physical device of this context.
uint32_t getSwapchainCount()
Returns the number of swapchain images.
void createCommandPool()
Creates the command pool for this context.
This class contains all relevant Vulkan objects to setup a Vulkan application.
SwapchainData getSwapchainData()
Returns the swapchain data.
static std::vector< PhysicalDevice * > getAvailablePhysicalDevices(Surface *surface)
Returns a list of available physical devices.
VkDevice getHandle()
Returns the handle of the logical device.
Generic namespace for the SimpleGL framework.
void createFramebuffers(RenderPass *renderPass)
Creates the swapchain framebuffers for this context.
CommandPool * getCommandPool()
Returns the command pool of this context.
This class wraps a Vulkan command pool.
This class wraps a Vulkan framebuffer.
void createSwapchain(Surface *surface, glm::ivec2 size)
Creates a swapchain for this context.
static PhysicalDevice * getSuitablePhysicalDevice(std::vector< PhysicalDevice * > physicalDevices)
Returns the most suitable physical device.
Instance * getInstance()
Returns the Vulkan instance of this context.
Fence * getRenderFence()
Returns the current fence for signaling that a command buffer has finished rendering.
static void setCurrent(VulkanContext *context)
Sets the current Vulkan context.
const bool debugMode
Tells if the library is compiled in debug mode.
This class wraps a Vulkan swapchain.
void setupDebugCallback()
Creates a debug report callback, if compiled in debug mode.
std::vector< VkImageView > imageViews
The image views for the swapchain images.
DescriptorPool * getDescriptorPool()
Returns the descriptor pool of this context.
void createLogicalDevice()
Creates the logical device for rendering.
void createDescriptorPool()
Create the descriptor pool for this context.
uint32_t getSwapchainIndex()
Returns the current swapchain image index.
~VulkanContext(void)
Destroys the Vulkan context.
This class wraps a Vulkan debug report callback.
This class wraps a Vulkan render pass.
This class wraps a Vulkan fence.
VulkanContext(void)
Creates a new Vulkan context.
void pickPhysicalDevice(Surface *surface)
Enumerates all available physical devices and picks a suitable physical device.
This class wraps a Vulkan surface.
uint32_t index
The current swapchain image index.
DebugReportCallback * getDebugReportCallback()
Returns the debug report callback of this context.
This class wraps a Vulkan logical device.
void createRenderFence()
Creates the render fence.
FramebufferVK * getSwapchainFramebuffer()
Returns the current swapchain framebuffers of this context.