add Present call to API

pull/8/head
cosmonaut 2020-12-16 20:19:11 -08:00
parent 67b0503935
commit fd731ac648
4 changed files with 37 additions and 1 deletions

View File

@ -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 */

View File

@ -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: */

View File

@ -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
{

View File

@ -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(