From 6f793a5a3cf7eab3d5733d859603d8c7dcf56ede Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 16 Dec 2020 16:38:09 -0800 Subject: [PATCH] started entry points --- src/Refresh.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/Refresh.c b/src/Refresh.c index 3b7eda3..f8e0b7f 100644 --- a/src/Refresh.c +++ b/src/Refresh.c @@ -34,3 +34,50 @@ static const REFRESH_Driver *drivers[] = { &VulkanDriver, NULL }; + +/* Version API */ + +uint32_t REFRESH_LinkedVersion(void) +{ + return REFRESH_COMPILED_VERSION; +} + +/* Driver Functions */ + +static int32_t selectedDriver = -1; + +REFRESH_Device* REFRESH_CreateDevice( + FNA3D_Device *fnaDevice +) { + if (selectedDriver < 0) + { + return NULL; + } + + return drivers[selectedDriver]->CreateDevice(fnaDevice); +} + +void REFRESH_DestroyDevice(REFRESH_Device *device) +{ + if (device == NULL) + { + return; + } + + device->DestroyDevice(device); +} + +void REFRESH_Clear( + REFRESH_Device *device, + REFRESH_ClearOptions options, + REFRESH_Vec4 **colors, + uint32_t colorCount, + float depth, + int32_t stencil +) { + if (device == NULL) + { + return; + } + device->Clear(device->driverData, options, colors, colorCount, depth, stencil); +}