2021-03-25 06:59:28 +00:00
|
|
|
#ifndef __QF_Vulkan_capture_h
|
|
|
|
#define __QF_Vulkan_capture_h
|
|
|
|
|
2022-05-08 08:57:40 +00:00
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
#endif
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
2021-03-25 06:59:28 +00:00
|
|
|
#include "QF/darray.h"
|
|
|
|
#include "QF/qtypes.h"
|
|
|
|
|
2023-06-25 12:01:34 +00:00
|
|
|
struct vulkan_ctx_s;
|
|
|
|
struct tex_s;
|
|
|
|
typedef void (*capfunc_t) (struct tex_s *screencap, void *data);
|
|
|
|
|
|
|
|
typedef struct qfv_capture_frame_s {
|
2023-07-03 11:05:27 +00:00
|
|
|
struct qfv_resobj_s *buffer;
|
2021-03-25 06:59:28 +00:00
|
|
|
byte *data;
|
|
|
|
|
2023-06-25 12:01:34 +00:00
|
|
|
bool initiated;
|
|
|
|
capfunc_t callback;
|
|
|
|
void *callback_data;
|
|
|
|
} qfv_capture_frame_t;
|
2021-03-25 06:59:28 +00:00
|
|
|
|
2023-06-25 12:01:34 +00:00
|
|
|
typedef struct qfv_capture_frame_set_s
|
|
|
|
DARRAY_TYPE (qfv_capture_frame_t) qfv_capture_frame_set_t;
|
2021-03-25 06:59:28 +00:00
|
|
|
|
2023-06-25 12:01:34 +00:00
|
|
|
typedef struct qfv_capturectx_s {
|
|
|
|
qfv_capture_frame_set_t frames;
|
2021-03-25 06:59:28 +00:00
|
|
|
VkExtent2D extent;
|
2022-04-01 07:19:10 +00:00
|
|
|
size_t imgsize;
|
|
|
|
byte *data;
|
2023-07-03 11:05:27 +00:00
|
|
|
struct qfv_resource_s *resources;
|
2023-06-25 12:01:34 +00:00
|
|
|
} qfv_capturectx_t;
|
2021-03-25 06:59:28 +00:00
|
|
|
|
2023-06-25 12:01:34 +00:00
|
|
|
struct vulkan_ctx_s;
|
2021-03-25 06:59:28 +00:00
|
|
|
|
2023-06-25 12:01:34 +00:00
|
|
|
void QFV_Capture_Init (struct vulkan_ctx_s *ctx);
|
|
|
|
void QFV_Capture_Renew (struct vulkan_ctx_s *ctx);
|
|
|
|
void QFV_Capture_Shutdown (struct vulkan_ctx_s *ctx);
|
|
|
|
void QFV_Capture_Screen (struct vulkan_ctx_s *ctx,
|
|
|
|
capfunc_t callback, void *data);
|
2021-03-25 06:59:28 +00:00
|
|
|
|
|
|
|
#endif//__QF_Vulkan_capture_h
|