diff --git a/include/Refresh.h b/include/Refresh.h index 46a6967..cee5123 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -1243,6 +1243,14 @@ REFRESHAPI void REFRESH_BindGraphicsPipeline( REFRESH_GraphicsPipeline *graphicsPipeline ); +/* Presentation */ + +REFRESHAPI void REFRESH_Present( + REFRESH_Device *device, + REFRESH_Rect *sourceRectangle, + REFRESH_Rect *destinationRectangle +); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/Refresh.c b/src/Refresh.c index af152dd..659a9b7 100644 --- a/src/Refresh.c +++ b/src/Refresh.c @@ -808,4 +808,17 @@ void REFRESH_BindGraphicsPipeline( ); } +void REFRESH_Present( + REFRESH_Device *device, + REFRESH_Rect *sourceRectangle, + REFRESH_Rect *destinationRectangle +) { + NULL_RETURN(device); + device->Present( + device->driverData, + sourceRectangle, + destinationRectangle + ); +} + /* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/src/Refresh_Driver.h b/src/Refresh_Driver.h index feeb03f..dec6ecc 100644 --- a/src/Refresh_Driver.h +++ b/src/Refresh_Driver.h @@ -490,6 +490,12 @@ struct REFRESH_Device REFRESH_GraphicsPipeline *graphicsPipeline ); + void(*Present)( + REFRESH_Renderer *driverData, + REFRESH_Rect *sourceRectangle, + REFRESH_Rect *destinationRectangle + ); + /* Opaque pointer for the Driver */ REFRESH_Renderer *driverData; }; @@ -539,7 +545,8 @@ struct REFRESH_Device ASSIGN_DRIVER_FUNC(AddDisposeGraphicsPipeline, name) \ ASSIGN_DRIVER_FUNC(BeginRenderPass, name) \ ASSIGN_DRIVER_FUNC(EndRenderPass, name) \ - ASSIGN_DRIVER_FUNC(BindGraphicsPipeline, name) + ASSIGN_DRIVER_FUNC(BindGraphicsPipeline, name) \ + ASSIGN_DRIVER_FUNC(Present, name) typedef struct REFRESH_Driver { diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index ca75aa5..e867a06 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -704,6 +704,14 @@ static void VULKAN_BindGraphicsPipeline( SDL_assert(0); } +static void VULKAN_Present( + REFRESH_Renderer *renderer, + REFRESH_Rect *sourceRectangle, + REFRESH_Rect *destinationRectangle +) { + SDL_assert(0); +} + /* Swapchain */ static inline VkExtent2D VULKAN_INTERNAL_ChooseSwapExtent(