start the process of making sync objects an extension
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// #ifdef GN_EXT_SYNCHRONIZATION
|
||||
|
||||
#include "gryphn_semaphore.h"
|
||||
#include "output_device/gryphn_output_device.h"
|
||||
#include "instance/gryphn_instance.h"
|
||||
|
||||
gnReturnCode gnCreateSemaphore(gnSemaphore* semaphore, struct gnOutputDevice_t* device) {
|
||||
*semaphore = malloc(sizeof(struct gnSemaphore_t));
|
||||
(*semaphore)->device = device;
|
||||
return device->instance->callingLayer->deviceFunctions._gnCreateSemaphore((*semaphore), device);
|
||||
}
|
||||
void gnDestroySemaphore(struct gnSemaphore_t* semaphore) {
|
||||
semaphore->device->instance->callingLayer->deviceFunctions._gnDestroySemaphore(semaphore);
|
||||
}
|
||||
|
||||
// #endif
|
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include "utils/gryphn_error_code.h"
|
||||
#include "utils/lists/gryphn_array_list.h"
|
||||
#include "gryphn_handles.h"
|
||||
|
||||
#ifdef GN_REVEAL_IMPL
|
||||
struct gnSemaphore_t {
|
||||
struct gnPlatformSemaphore_t* semaphore;
|
||||
gnOutputDeviceHandle device;
|
||||
};
|
||||
#endif
|
||||
GN_ARRAY_LIST(gnSemaphore);
|
||||
|
||||
gnReturnCode gnCreateSemaphore(gnSemaphore* semaphore, struct gnOutputDevice_t* device);
|
||||
void gnDestroySemaphore(gnSemaphore semaphore);
|
Reference in New Issue
Block a user