mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 02:34:23 -05:00
libobs: Add function to check fast clear capability
This commit is contained in:
@@ -3593,3 +3593,8 @@ uint32_t gs_get_adapter_count(void)
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
extern "C" EXPORT bool device_can_adapter_fast_clear(gs_device_t *device)
|
||||
{
|
||||
return device->fastClearSupported;
|
||||
}
|
||||
|
||||
@@ -221,6 +221,7 @@ bool load_graphics_imports(struct gs_exports *exports, void *module,
|
||||
GRAPHICS_IMPORT_OPTIONAL(gs_duplicator_get_color_space);
|
||||
GRAPHICS_IMPORT_OPTIONAL(gs_duplicator_get_sdr_white_level);
|
||||
GRAPHICS_IMPORT_OPTIONAL(gs_get_adapter_count);
|
||||
GRAPHICS_IMPORT_OPTIONAL(device_can_adapter_fast_clear);
|
||||
GRAPHICS_IMPORT_OPTIONAL(device_texture_create_gdi);
|
||||
GRAPHICS_IMPORT_OPTIONAL(gs_texture_get_dc);
|
||||
GRAPHICS_IMPORT_OPTIONAL(gs_texture_release_dc);
|
||||
|
||||
@@ -312,6 +312,7 @@ struct gs_exports {
|
||||
float (*gs_duplicator_get_sdr_white_level)(gs_duplicator_t *duplicator);
|
||||
|
||||
uint32_t (*gs_get_adapter_count)(void);
|
||||
bool (*device_can_adapter_fast_clear)(gs_device_t *device);
|
||||
|
||||
gs_texture_t *(*device_texture_create_gdi)(gs_device_t *device,
|
||||
uint32_t width,
|
||||
|
||||
@@ -3040,6 +3040,17 @@ uint32_t gs_get_adapter_count(void)
|
||||
return thread_graphics->exports.gs_get_adapter_count();
|
||||
}
|
||||
|
||||
bool gs_can_adapter_fast_clear(void)
|
||||
{
|
||||
if (!gs_valid("gs_can_adapter_fast_clear"))
|
||||
return false;
|
||||
if (!thread_graphics->exports.device_can_adapter_fast_clear)
|
||||
return false;
|
||||
|
||||
return thread_graphics->exports.device_can_adapter_fast_clear(
|
||||
thread_graphics->device);
|
||||
}
|
||||
|
||||
gs_texture_t *gs_duplicator_get_texture(gs_duplicator_t *duplicator)
|
||||
{
|
||||
if (!gs_valid_p("gs_duplicator_get_texture", duplicator))
|
||||
|
||||
@@ -924,6 +924,7 @@ gs_duplicator_get_color_space(gs_duplicator_t *duplicator);
|
||||
EXPORT float gs_duplicator_get_sdr_white_level(gs_duplicator_t *duplicator);
|
||||
|
||||
EXPORT uint32_t gs_get_adapter_count(void);
|
||||
EXPORT bool gs_can_adapter_fast_clear(void);
|
||||
|
||||
/** creates a windows GDI-lockable texture */
|
||||
EXPORT gs_texture_t *gs_texture_create_gdi(uint32_t width, uint32_t height);
|
||||
|
||||
Reference in New Issue
Block a user