diff --git a/rendering_api/metal/src/core/present/metal_present.m b/rendering_api/metal/src/core/present/metal_present.m index 1c94795..8bd33e9 100644 --- a/rendering_api/metal/src/core/present/metal_present.m +++ b/rendering_api/metal/src/core/present/metal_present.m @@ -8,9 +8,9 @@ #include "core/texture/metal_texture.h" #import -gnReturnCode gnPresentFn(struct gnOutputDevice_t* device, struct gnPresentInfo_t info) { +gnReturnCode gnPresentFn(gnOutputDeviceHandle device, struct gnPresentInfo_t info) { for (int i = 0; i < info.waitCount; i++) { - while (!info.waitSemaphores[i].semaphore->eventTriggered) {} + while (!info.waitSemaphores[i]->semaphore->eventTriggered) {} } for (int i =0 ; i < info.presentationQueueCount; i++) { diff --git a/rendering_api/metal/src/core/submit/metal_submit.m b/rendering_api/metal/src/core/submit/metal_submit.m index f54eb46..7eaddd8 100644 --- a/rendering_api/metal/src/core/submit/metal_submit.m +++ b/rendering_api/metal/src/core/submit/metal_submit.m @@ -6,19 +6,19 @@ gnReturnCode gnSubmitFn(struct gnOutputDevice_t* device, struct gnSubmitInfo_t info) { for (int i = 0; i < info.waitCount; i++) { - while (!info.waitSemaphores[i].semaphore->eventTriggered) {} + while (!info.waitSemaphores[i]->semaphore->eventTriggered) {} } __block gnSemaphore* semsToSignal = info.signalSemaphores; __block int semsToSignalCount = info.signalCount; - __block gnFence* fenceToSignal = info.fence; + __block gnFence fenceToSignal = info.fence; for (int i = 0; i < info.commandBufferCount; i++) { id commandBuffer = info.commandBuffers[i]->commandBuffer->commandBuffer; [info.commandBuffers[i]->commandBuffer->commandBuffer addCompletedHandler:^(id buffer) { for (int c = 0; c < semsToSignalCount; c++) { - semsToSignal[c].semaphore->eventTriggered = gnTrue; + semsToSignal[c]->semaphore->eventTriggered = gnTrue; } }]; fenceToSignal->signaled = gnTrue; diff --git a/rendering_api/metal/src/core/sync/semaphore/metal_semaphore.h b/rendering_api/metal/src/core/sync/semaphore/metal_semaphore.h index f433c97..f3477d8 100644 --- a/rendering_api/metal/src/core/sync/semaphore/metal_semaphore.h +++ b/rendering_api/metal/src/core/sync/semaphore/metal_semaphore.h @@ -4,5 +4,5 @@ typedef struct gnPlatformSemaphore_t { id event; - gnBool eventTriggered; + bool eventTriggered; } gnPlatformSemaphore; diff --git a/rendering_api/vulkan/src/present/vulkan_present.c b/rendering_api/vulkan/src/present/vulkan_present.c index 7d2c907..45bfc38 100644 --- a/rendering_api/vulkan/src/present/vulkan_present.c +++ b/rendering_api/vulkan/src/present/vulkan_present.c @@ -7,7 +7,7 @@ gnReturnCode gnPresentFn(struct gnOutputDevice_t* device, struct gnPresentInfo_t info) { VkSemaphore* waitSemaphores = malloc(sizeof(VkSemaphore) * info.waitCount); - for (int i = 0; i < info.waitCount; i++) waitSemaphores[i] = info.waitSemaphores[i].semaphore->semaphore; + for (int i = 0; i < info.waitCount; i++) waitSemaphores[i] = info.waitSemaphores[i]->semaphore->semaphore; VkSwapchainKHR* swapchains = malloc(sizeof(VkSwapchainKHR) * info.presentationQueueCount); for (int i = 0; i < info.presentationQueueCount; i++) swapchains[i] = info.presentationQueues[i]->presentationQueue->swapChain; diff --git a/rendering_api/vulkan/src/submit/vulkan_submit.c b/rendering_api/vulkan/src/submit/vulkan_submit.c index bd760a9..f768c36 100644 --- a/rendering_api/vulkan/src/submit/vulkan_submit.c +++ b/rendering_api/vulkan/src/submit/vulkan_submit.c @@ -17,14 +17,14 @@ gnReturnCode gnSubmitFn(struct gnOutputDevice_t* device, struct gnSubmitInfo_t i VkSemaphore* waitSemaphores = malloc(sizeof(VkSemaphore) * info.waitCount); VkPipelineStageFlags* waitStages = malloc(sizeof(VkPipelineStageFlags) * info.waitCount); - for (int i = 0; i < info.waitCount; i++) waitSemaphores[i] = info.waitSemaphores[i].semaphore->semaphore; + for (int i = 0; i < info.waitCount; i++) waitSemaphores[i] = info.waitSemaphores[i]->semaphore->semaphore; for (int i = 0; i < info.waitCount; i++) waitStages[i] = vkGryphnWaitStage(info.waitStages[i]); VkCommandBuffer* commandBuffers = malloc(sizeof(VkCommandBuffer) * info.commandBufferCount); for (int i = 0; i < info.commandBufferCount; i++) commandBuffers[i] = info.commandBuffers[i]->commandBuffer->buffer; VkSemaphore* signalSemaphores = malloc(sizeof(VkSemaphore) * info.signalCount); - for (int i = 0; i < info.signalCount; i++) signalSemaphores[i] = info.signalSemaphores[i].semaphore->semaphore; + for (int i = 0; i < info.signalCount; i++) signalSemaphores[i] = info.signalSemaphores[i]->semaphore->semaphore; VkSubmitInfo submitInfo = { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, diff --git a/src/core/gryphn_handles.h b/src/core/gryphn_handles.h index f89435d..0ccef3d 100644 --- a/src/core/gryphn_handles.h +++ b/src/core/gryphn_handles.h @@ -15,3 +15,5 @@ GN_HANDLE(gnShaderModule); GN_HANDLE(gnGraphicsPipeline); GN_HANDLE(gnCommandPool); GN_HANDLE(gnCommandBuffer); +GN_HANDLE(gnSemaphore); +GN_HANDLE(gnFence); diff --git a/src/core/gryphn_platform_functions.h b/src/core/gryphn_platform_functions.h index 9d9799a..90b0ea2 100644 --- a/src/core/gryphn_platform_functions.h +++ b/src/core/gryphn_platform_functions.h @@ -20,14 +20,14 @@ #include "core/present/gryphn_present.h" typedef struct gnFunctions_t { - gnReturnCode (*_gnCreateInstance)(gnInstanceHandle instance, struct gnInstanceInfo_t info); + gnReturnCode (*_gnCreateInstance)(gnInstanceHandle instance, gnInstanceInfo info); void (*_gnDestroyInstance)(gnInstanceHandle instance); - gnReturnCode (*_gnCreateDebugger)(gnDebuggerHandle debugger, gnInstanceHandle instance, const struct gnDebuggerInfo_t info); + gnReturnCode (*_gnCreateDebugger)(gnDebuggerHandle debugger, gnInstanceHandle instance, const gnDebuggerInfo info); void (*_gnDestroyDebugger)(gnDebuggerHandle debugger); gnPhysicalDevice* (*_gnGetPhysicalDevices)(gnInstanceHandle instance, uint32_t* count); - gnBool (*_gnQueueCanPresentToSurface)(const struct gnPhysicalDevice_t device, uint32_t queueIndex, const gnWindowSurfaceHandle windowSurface); + gnBool (*_gnQueueCanPresentToSurface)(const gnPhysicalDevice device, uint32_t queueIndex, const gnWindowSurfaceHandle windowSurface); gnReturnCode (*_gnCreateOutputDevoce)(gnOutputDeviceHandle device, gnInstanceHandle instance, struct gnOutputDeviceInfo_t deviceInfo); @@ -59,33 +59,33 @@ typedef struct gnFunctions_t { #include "core/presentation_queue/gryphn_presentation_queue.h" typedef struct gnDeviceFunctions_t { - gnReturnCode (*_gnCreatePresentationQueue)(gnPresentationQueueHandle presentationQueue, const gnOutputDeviceHandle device, struct gnPresentationQueueInfo_t presentationInfo); - gnReturnCode (*_gnPresentationQueueGetImage)(gnPresentationQueueHandle presentationQueue, uint64_t timeout, struct gnSemaphore_t* semaphore, uint32_t* imageIndex); + gnReturnCode (*_gnCreatePresentationQueue)(gnPresentationQueueHandle presentationQueue, const gnOutputDeviceHandle device, gnPresentationQueueInfo presentationInfo); + gnReturnCode (*_gnPresentationQueueGetImage)(gnPresentationQueueHandle presentationQueue, uint64_t timeout, gnSemaphoreHandle semaphore, uint32_t* imageIndex); void (*_gnDestroyPresentationQueue)(gnPresentationQueueHandle presentationQueue); - gnReturnCode (*_gnCreateShaderModule)(gnShaderModuleHandle module, gnOutputDeviceHandle device, struct gnShaderModuleInfo_t shaderModuleInfo); + gnReturnCode (*_gnCreateShaderModule)(gnShaderModuleHandle module, gnOutputDeviceHandle device, gnShaderModuleInfo shaderModuleInfo); void (*_gnDestroyShaderModule)(gnShaderModuleHandle module); - gnReturnCode (*_gnCreateRenderPassDescriptor)(gnRenderPassDescriptorHandle renderPass, gnOutputDeviceHandle device, struct gnRenderPassDescriptorInfo_t info); + gnReturnCode (*_gnCreateRenderPassDescriptor)(gnRenderPassDescriptorHandle renderPass, gnOutputDeviceHandle device, gnRenderPassDescriptorInfo info); void (*_gnDestroyRenderPassDescriptor)(gnRenderPassDescriptorHandle renderPass); - gnReturnCode (*_gnCreateGraphicsPipeline)(gnGraphicsPipelineHandle pipeline, gnOutputDeviceHandle device, struct gnGraphicsPipelineInfo_t pipelineInfo); + gnReturnCode (*_gnCreateGraphicsPipeline)(gnGraphicsPipelineHandle pipeline, gnOutputDeviceHandle device, gnGraphicsPipelineInfo pipelineInfo); void (*_gnDestroyGraphicsPipeline)(gnGraphicsPipelineHandle pipeline); - gnReturnCode (*_gnCreateFramebuffer)(struct gnFramebuffer_t* framebuffer, gnOutputDeviceHandle device, struct gnFramebufferInfo_t framebufferInfo); + gnReturnCode (*_gnCreateFramebuffer)(struct gnFramebuffer_t* framebuffer, gnOutputDeviceHandle device, gnFramebufferInfo framebufferInfo); void (*_gnDestroyFramebuffer)(struct gnFramebuffer_t* framebuffer); - gnReturnCode (*_gnCreateCommandPool)(gnCommandPoolHandle commandPool, gnOutputDeviceHandle device, struct gnCommandPoolInfo_t info); + gnReturnCode (*_gnCreateCommandPool)(gnCommandPoolHandle commandPool, gnOutputDeviceHandle device, gnCommandPoolInfo info); void (*_gnDestroyCommandPool)(gnCommandPoolHandle commandPool); - gnReturnCode (*_gnCreateSemaphore)(struct gnSemaphore_t* semaphore, gnOutputDeviceHandle device); - void (*_gnDestroySemaphore)(struct gnSemaphore_t* semaphore); + gnReturnCode (*_gnCreateSemaphore)(gnSemaphoreHandle semaphore, gnOutputDeviceHandle device); + void (*_gnDestroySemaphore)(gnSemaphoreHandle semaphore); - gnReturnCode (*_gnCreateFence)(struct gnFence_t* fence, gnOutputDeviceHandle device); - void (*_gnSignalFence)(struct gnFence_t* fence); - void (*_gnWaitForFence)(struct gnFence_t* fence, uint64_t timeout); - void (*_gnResetFence)(struct gnFence_t* fence); - void (*_gnDestroyFence)(struct gnFence_t* fence); + gnReturnCode (*_gnCreateFence)(gnFenceHandle fence, gnOutputDeviceHandle device); + void (*_gnSignalFence)(gnFenceHandle fence); + void (*_gnWaitForFence)(gnFenceHandle fence, uint64_t timeout); + void (*_gnResetFence)(gnFenceHandle fence); + void (*_gnDestroyFence)(gnFenceHandle fence); gnReturnCode (*_gnSubmit)(gnOutputDeviceHandle device, gnSubmitInfo submit); gnReturnCode (*_gnPresent)(gnOutputDeviceHandle device, gnPresentInfo info); @@ -99,7 +99,7 @@ typedef struct gnCommandFunctions_t { void (*_gnResetCommandBuffer)(gnCommandBufferHandle commandBuffer); gnReturnCode (*_gnEndCommandBuffer)(gnCommandBufferHandle commandBuffer); - void (*_gnCommandBeginRenderPass)(gnCommandBufferHandle buffer, struct gnRenderPassInfo_t passInfo); + void (*_gnCommandBeginRenderPass)(gnCommandBufferHandle buffer, gnRenderPassInfo passInfo); void (*_gnCommandEndRenderPass)(gnCommandBufferHandle buffer); void (*_gnCommandBindGraphicsPipeline)(gnCommandBufferHandle buffer, gnGraphicsPipelineHandle graphicsPipeline); diff --git a/src/core/present/gryphn_present.c b/src/core/present/gryphn_present.c index 100cad1..172b7ce 100644 --- a/src/core/present/gryphn_present.c +++ b/src/core/present/gryphn_present.c @@ -1,6 +1,6 @@ #include "core/gryphn_platform_functions.h" #include "gryphn_present.h" -gnReturnCode gnPresent(struct gnOutputDevice_t* device, struct gnPresentInfo_t info) { +gnReturnCode gnPresent(gnOutputDeviceHandle device, gnPresentInfo info) { return device->deviceFunctions->_gnPresent(device, info); } diff --git a/src/core/present/gryphn_present.h b/src/core/present/gryphn_present.h index ac2f3fa..832d174 100644 --- a/src/core/present/gryphn_present.h +++ b/src/core/present/gryphn_present.h @@ -1,14 +1,15 @@ #pragma once -#include "core/sync/semaphore/gryphn_semaphore.h" -#include "core/presentation_queue/gryphn_presentation_queue.h" +#include "utils/gryphn_error_code.h" +#include "stdint.h" +#include "core/gryphn_handles.h" typedef struct gnPresentInfo_t { uint32_t waitCount; - struct gnSemaphore_t* waitSemaphores; + gnSemaphoreHandle* waitSemaphores; uint32_t presentationQueueCount; gnPresentationQueueHandle* presentationQueues; uint32_t* imageIndices; uint32_t queueIndex; } gnPresentInfo; -gnReturnCode gnPresent(struct gnOutputDevice_t* device, struct gnPresentInfo_t info); +gnReturnCode gnPresent(gnOutputDeviceHandle device, gnPresentInfo info); diff --git a/src/core/presentation_queue/gryphn_presentation_queue.c b/src/core/presentation_queue/gryphn_presentation_queue.c index ee32820..9978ba7 100644 --- a/src/core/presentation_queue/gryphn_presentation_queue.c +++ b/src/core/presentation_queue/gryphn_presentation_queue.c @@ -1,14 +1,14 @@ #include "gryphn_presentation_queue.h" #include "core/gryphn_platform_functions.h" -gnReturnCode gnCreatePresentationQueue(gnPresentationQueueHandle* presentationQueue, struct gnOutputDevice_t* device, struct gnPresentationQueueInfo_t presentationInfo){ +gnReturnCode gnCreatePresentationQueue(gnPresentationQueueHandle* presentationQueue, gnOutputDeviceHandle device, gnPresentationQueueInfo presentationInfo){ *presentationQueue = malloc(sizeof(struct gnPresentationQueue_t)); (*presentationQueue)->outputDevice = device; (*presentationQueue)->info = presentationInfo; return device->deviceFunctions->_gnCreatePresentationQueue(*presentationQueue, device, presentationInfo); } -gnReturnCode gnPresentationQueueGetImage(gnPresentationQueueHandle presentationQueue, uint64_t timeout, struct gnSemaphore_t* semaphore, uint32_t* imageIndex) { +gnReturnCode gnPresentationQueueGetImage(gnPresentationQueueHandle presentationQueue, uint64_t timeout, gnSemaphoreHandle semaphore, uint32_t* imageIndex) { return presentationQueue->outputDevice->deviceFunctions->_gnPresentationQueueGetImage(presentationQueue, timeout, semaphore, imageIndex); } uint32_t gnGetPresentationQueueImageCount(gnPresentationQueueHandle presentationQueue) { return presentationQueue->imageCount; } diff --git a/src/core/presentation_queue/gryphn_presentation_queue.h b/src/core/presentation_queue/gryphn_presentation_queue.h index 2d3b072..275e7a2 100644 --- a/src/core/presentation_queue/gryphn_presentation_queue.h +++ b/src/core/presentation_queue/gryphn_presentation_queue.h @@ -29,8 +29,8 @@ struct gnPresentationQueue_t { }; #endif -gnReturnCode gnCreatePresentationQueue(gnPresentationQueueHandle* presentationQueue, struct gnOutputDevice_t* device, struct gnPresentationQueueInfo_t presentationInfo); -gnReturnCode gnPresentationQueueGetImage(gnPresentationQueueHandle presentationQueue, uint64_t timeout, struct gnSemaphore_t* semaphore, uint32_t* imageIndex); +gnReturnCode gnCreatePresentationQueue(gnPresentationQueueHandle* presentationQueue, gnOutputDeviceHandle device, gnPresentationQueueInfo presentationInfo); +gnReturnCode gnPresentationQueueGetImage(gnPresentationQueueHandle presentationQueue, uint64_t timeout, gnSemaphoreHandle semaphore, uint32_t* imageIndex); uint32_t gnGetPresentationQueueImageCount(gnPresentationQueueHandle presentationQueue); gnTextureHandle gnGetPresentationQueueImage(gnPresentationQueueHandle presentationQueue, uint32_t index); void gnDestroyPresentationQueue(gnPresentationQueueHandle presentationQueue); diff --git a/src/core/submit/gryphn_submit.c b/src/core/submit/gryphn_submit.c index 2496002..2968d8f 100644 --- a/src/core/submit/gryphn_submit.c +++ b/src/core/submit/gryphn_submit.c @@ -1,6 +1,6 @@ #include "gryphn_submit.h" #include "core/gryphn_platform_functions.h" -gnReturnCode gnSubmit(struct gnOutputDevice_t* device, struct gnSubmitInfo_t info) { +gnReturnCode gnSubmit(gnOutputDevice device, gnSubmitInfo info) { return device->deviceFunctions->_gnSubmit(device, info); } diff --git a/src/core/submit/gryphn_submit.h b/src/core/submit/gryphn_submit.h index 961da53..ad11fba 100644 --- a/src/core/submit/gryphn_submit.h +++ b/src/core/submit/gryphn_submit.h @@ -1,19 +1,17 @@ #pragma once #include "stdint.h" -#include "core/sync/semaphore/gryphn_semaphore.h" #include "core/sync/fence/gryphn_fence.h" -#include "core/output_device/gryphn_output_device.h" typedef struct gnSubmitInfo_t { uint32_t waitCount; enum gnRenderPassStage_e* waitStages; - struct gnSemaphore_t* waitSemaphores; + gnSemaphoreHandle* waitSemaphores; uint32_t signalCount; - struct gnSemaphore_t* signalSemaphores; + gnSemaphoreHandle* signalSemaphores; uint32_t commandBufferCount; gnCommandBufferHandle* commandBuffers; uint32_t queueIndex; struct gnFence_t* fence; } gnSubmitInfo; -gnReturnCode gnSubmit(struct gnOutputDevice_t* device, struct gnSubmitInfo_t submit); +gnReturnCode gnSubmit(gnOutputDevice device, gnSubmitInfo info); diff --git a/src/core/sync/fence/gryphn_fence.c b/src/core/sync/fence/gryphn_fence.c index 4b365ec..3f57b24 100644 --- a/src/core/sync/fence/gryphn_fence.c +++ b/src/core/sync/fence/gryphn_fence.c @@ -2,23 +2,24 @@ #include "core/gryphn_platform_functions.h" #include "stdio.h" -gnReturnCode gnCreateFence(struct gnFence_t* fence, struct gnOutputDevice_t* device) { - fence->device = device; - fence->signaled = gnFalse; - return device->deviceFunctions->_gnCreateFence(fence, device); +gnReturnCode gnCreateFence(gnFenceHandle* fence, struct gnOutputDevice_t* device) { + *fence = malloc(sizeof(struct gnFence_t)); + (*fence)->device = device; + (*fence)->signaled = gnFalse; + return device->deviceFunctions->_gnCreateFence(*fence, device); } -void gnSignalFence(struct gnFence_t* fence) { +void gnSignalFence(gnFenceHandle fence) { fence->signaled = gnTrue; // fence->device->deviceFunctions->_gnSignalFence(fence); } -void gnWaitForFence(struct gnFence_t* fence, uint64_t timeout) { +void gnWaitForFence(gnFenceHandle fence, uint64_t timeout) { if (fence->signaled == gnTrue) return; fence->device->deviceFunctions->_gnWaitForFence(fence, timeout); } -void gnResetFence(struct gnFence_t* fence) { +void gnResetFence(gnFenceHandle fence) { fence->signaled = gnFalse; fence->device->deviceFunctions->_gnResetFence(fence); } -void gnDestroyFence(struct gnFence_t* fence) { +void gnDestroyFence(gnFenceHandle fence) { fence->device->deviceFunctions->_gnDestroyFence(fence); } diff --git a/src/core/sync/fence/gryphn_fence.h b/src/core/sync/fence/gryphn_fence.h index eeb810d..5e13c8a 100644 --- a/src/core/sync/fence/gryphn_fence.h +++ b/src/core/sync/fence/gryphn_fence.h @@ -1,15 +1,18 @@ #pragma once -#include "core/output_device/gryphn_output_device.h" +#include "core/gryphn_handles.h" +#include "utils/gryphn_bool.h" +#include "utils/gryphn_error_code.h" - -typedef struct gnFence_t { +#ifdef GN_REVEAL_IMPL +struct gnFence_t { struct gnPlatformFence_t* fence; - struct gnOutputDevice_t* device; + gnOutputDeviceHandle device; gnBool signaled; -} gnFence; +}; +#endif -gnReturnCode gnCreateFence(struct gnFence_t* fence, struct gnOutputDevice_t* device); -void gnSignalFence(struct gnFence_t* fence); -void gnWaitForFence(struct gnFence_t* fence, uint64_t timeout); -void gnResetFence(struct gnFence_t* fence); -void gnDestroyFence(struct gnFence_t* fence); +gnReturnCode gnCreateFence(gnFenceHandle* fence, gnOutputDeviceHandle device); +void gnSignalFence(gnFenceHandle fence); +void gnWaitForFence(gnFenceHandle fence, uint64_t timeout); +void gnResetFence(gnFenceHandle fence); +void gnDestroyFence(gnFenceHandle fence); diff --git a/src/core/sync/semaphore/gryphn_semaphore.c b/src/core/sync/semaphore/gryphn_semaphore.c index 7be89aa..dbbd426 100644 --- a/src/core/sync/semaphore/gryphn_semaphore.c +++ b/src/core/sync/semaphore/gryphn_semaphore.c @@ -1,9 +1,10 @@ #include "gryphn_semaphore.h" #include "core/gryphn_platform_functions.h" -gnReturnCode gnCreateSemaphore(struct gnSemaphore_t* semaphore, struct gnOutputDevice_t* device) { - semaphore->device = device; - return device->deviceFunctions->_gnCreateSemaphore(semaphore, device); +gnReturnCode gnCreateSemaphore(gnSemaphore* semaphore, struct gnOutputDevice_t* device) { + *semaphore = malloc(sizeof(struct gnSemaphore_t)); + (*semaphore)->device = device; + return device->deviceFunctions->_gnCreateSemaphore((*semaphore), device); } void gnDestroySemaphore(struct gnSemaphore_t* semaphore) { semaphore->device->deviceFunctions->_gnDestroySemaphore(semaphore); diff --git a/src/core/sync/semaphore/gryphn_semaphore.h b/src/core/sync/semaphore/gryphn_semaphore.h index bb65e96..b647218 100644 --- a/src/core/sync/semaphore/gryphn_semaphore.h +++ b/src/core/sync/semaphore/gryphn_semaphore.h @@ -1,10 +1,13 @@ #pragma once -#include "core/output_device/gryphn_output_device.h" +#include "core/gryphn_handles.h" +#include "utils/gryphn_error_code.h" -typedef struct gnSemaphore_t { +#ifdef GN_REVEAL_IMPL +struct gnSemaphore_t { struct gnPlatformSemaphore_t* semaphore; - struct gnOutputDevice_t* device; -} gnSemaphore; + gnOutputDeviceHandle device; +}; +#endif -gnReturnCode gnCreateSemaphore(struct gnSemaphore_t* semaphore, struct gnOutputDevice_t* device); -void gnDestroySemaphore(struct gnSemaphore_t* semaphore); +gnReturnCode gnCreateSemaphore(gnSemaphore* semaphore, struct gnOutputDevice_t* device); +void gnDestroySemaphore(gnSemaphore semaphore);