18 Semaphore::Semaphore(
void) {
19 VkDevice device = VulkanContext::getCurrent()->getDevice()->getHandle();
22 VkSemaphoreCreateInfo createInfo = {};
23 createInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
26 if (vkCreateSemaphore(device, &createInfo,
nullptr, &handle) != VK_SUCCESS) {
27 throw runtime_error(
"Could not create a semaphore!");
31 Semaphore::~Semaphore(
void) {
32 VkDevice device = VulkanContext::getCurrent()->getDevice()->getHandle();
35 vkDestroySemaphore(device, handle,
nullptr);
38 VkSemaphore Semaphore::getHandle() {
43 VkDevice device = VulkanContext::getCurrent()->getDevice()->getHandle();
46 VkFenceCreateInfo createInfo = {};
47 createInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
48 createInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT;
51 if (vkCreateFence(device, &createInfo,
nullptr, &handle) != VK_SUCCESS) {
52 throw runtime_error(
"Could not create a fence!");
57 VkDevice device = VulkanContext::getCurrent()->getDevice()->getHandle();
60 vkDestroyFence(device, handle,
nullptr);
63 VkFence Fence::getHandle() {
Generic namespace for the SimpleGL framework.