mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
libobs/graphics: Add gs_is_monitor_hdr
Only Windows is implemented for now. Mac/Linux return false for now.
This commit is contained in:
@@ -195,6 +195,8 @@ bool load_graphics_imports(struct gs_exports *exports, void *module,
|
||||
GRAPHICS_IMPORT_OPTIONAL(device_nv12_available);
|
||||
GRAPHICS_IMPORT_OPTIONAL(device_p010_available);
|
||||
|
||||
GRAPHICS_IMPORT(device_is_monitor_hdr);
|
||||
|
||||
GRAPHICS_IMPORT(device_debug_marker_begin);
|
||||
GRAPHICS_IMPORT(device_debug_marker_end);
|
||||
|
||||
|
||||
@@ -273,6 +273,8 @@ struct gs_exports {
|
||||
bool (*device_nv12_available)(gs_device_t *device);
|
||||
bool (*device_p010_available)(gs_device_t *device);
|
||||
|
||||
bool (*device_is_monitor_hdr)(gs_device_t *device, void *monitor);
|
||||
|
||||
void (*device_debug_marker_begin)(gs_device_t *device,
|
||||
const char *markername,
|
||||
const float color[4]);
|
||||
|
||||
@@ -2840,6 +2840,15 @@ bool gs_p010_available(void)
|
||||
thread_graphics->device);
|
||||
}
|
||||
|
||||
bool gs_is_monitor_hdr(void *monitor)
|
||||
{
|
||||
if (!gs_valid("gs_is_monitor_hdr"))
|
||||
return false;
|
||||
|
||||
return thread_graphics->exports.device_is_monitor_hdr(
|
||||
thread_graphics->device, monitor);
|
||||
}
|
||||
|
||||
void gs_debug_marker_begin(const float color[4], const char *markername)
|
||||
{
|
||||
if (!gs_valid("gs_debug_marker_begin"))
|
||||
|
||||
@@ -851,6 +851,8 @@ EXPORT bool gs_timer_range_get_data(gs_timer_range_t *range, bool *disjoint,
|
||||
EXPORT bool gs_nv12_available(void);
|
||||
EXPORT bool gs_p010_available(void);
|
||||
|
||||
EXPORT bool gs_is_monitor_hdr(void *monitor);
|
||||
|
||||
#define GS_USE_DEBUG_MARKERS 0
|
||||
#if GS_USE_DEBUG_MARKERS
|
||||
static const float GS_DEBUG_COLOR_DEFAULT[] = {0.5f, 0.5f, 0.5f, 1.0f};
|
||||
|
||||
Reference in New Issue
Block a user