Vulkan2D
2D renderer written in C using Vulkan and SDL2
VulkanInterface.h
Go to the documentation of this file.
1 #pragma once
5 #include "VK2D/Structs.h"
6 #define VMA_VULKAN_VERSION 1002000
7 #include <VulkanMemoryAllocator/src/VmaUsage.h>
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
15 VkCommandBuffer vk2dVulkanGetSingleUseBuffer();
16 
19 void vk2dVulkanSubmitSingleUseBuffer(VkCommandBuffer buffer);
20 
25 VkCommandBuffer vk2dVulkanGetDrawBuffer();
26 
35 void vk2dVulkanCopyDataIntoBuffer(void *data, VkDeviceSize size, VkBuffer *outBuffer, VkDeviceSize *bufferOffset);
36 
40 
44 
48 
51 VkPhysicalDevice vk2dVulkanGetPhysicalDevice();
52 
56 
60 
64 
68 
71 VmaAllocator vk2dVulkanGetVMA();
72 
73 #ifdef __cplusplus
74 }
75 #endif
Forward declares struct typedefs.
uint32_t vk2dVulkanGetQueueFamily()
Returns the queue family in use.
VmaAllocator vk2dVulkanGetVMA()
Returns the VMA instance.
VkQueue vk2dVulkanGetQueue()
Returns the queue being used for everything.
int vk2dVulkanGetFrame()
Returns the current frame being rendered.
void vk2dVulkanSubmitSingleUseBuffer(VkCommandBuffer buffer)
Submits a command buffer previously acquired with vk2dVulkanGetSingleUseBuffer and waits for the queu...
VkCommandBuffer vk2dVulkanGetDrawBuffer()
Returns the command buffer being used to draw the active frame.
uint32_t vk2dVulkanGetSwapchainImageCount()
Returns the swapchain image count.
int vk2dVulkanGetSwapchainImageIndex()
Returns the current swapchain image being used this frame.
VkDevice vk2dVulkanGetDevice()
Returns the logical device.
uint32_t vk2dVulkanGetMaxFramesInFlight()
Returns the maximum number of frames in flight allowed at once.
VkCommandBuffer vk2dVulkanGetSingleUseBuffer()
Returns a command buffer intended to be used once.
void vk2dVulkanCopyDataIntoBuffer(void *data, VkDeviceSize size, VkBuffer *outBuffer, VkDeviceSize *bufferOffset)
Copies arbitrary data into a device-local buffer that can then be accessed from command buffers.
VkPhysicalDevice vk2dVulkanGetPhysicalDevice()
Returns the renderer-selected physical device.