mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Add cocoa_update_title to cocoa_common.m
This commit is contained in:
parent
3d17cf1e38
commit
a80a64f261
@ -238,23 +238,6 @@ static void cocoa_gl_gfx_ctx_destroy(void *data)
|
|||||||
static enum gfx_ctx_api cocoa_gl_gfx_ctx_get_api(void *data) { return cocoagl_api; }
|
static enum gfx_ctx_api cocoa_gl_gfx_ctx_get_api(void *data) { return cocoagl_api; }
|
||||||
|
|
||||||
#ifdef OSX
|
#ifdef OSX
|
||||||
static void cocoa_gl_gfx_ctx_update_title(void *data)
|
|
||||||
{
|
|
||||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
char title[128];
|
|
||||||
|
|
||||||
title[0] = '\0';
|
|
||||||
|
|
||||||
video_driver_get_window_title(title, sizeof(title));
|
|
||||||
|
|
||||||
if (title[0])
|
|
||||||
window->set_title((void*)video_driver_display_userdata_get(), title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool cocoa_gl_gfx_ctx_get_metrics(
|
static bool cocoa_gl_gfx_ctx_get_metrics(
|
||||||
void *data, enum display_metric_types type,
|
void *data, enum display_metric_types type,
|
||||||
float *value)
|
float *value)
|
||||||
@ -874,7 +857,7 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = {
|
|||||||
cocoa_gl_gfx_ctx_get_metrics,
|
cocoa_gl_gfx_ctx_get_metrics,
|
||||||
NULL, /* translate_aspect */
|
NULL, /* translate_aspect */
|
||||||
#ifdef OSX
|
#ifdef OSX
|
||||||
cocoa_gl_gfx_ctx_update_title,
|
cocoa_update_title,
|
||||||
#else
|
#else
|
||||||
NULL, /* update_title */
|
NULL, /* update_title */
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,6 +115,7 @@ void *cocoa_screen_get_chosen(void);
|
|||||||
|
|
||||||
#ifdef OSX
|
#ifdef OSX
|
||||||
float cocoa_screen_get_backing_scale_factor(void);
|
float cocoa_screen_get_backing_scale_factor(void);
|
||||||
|
void cocoa_update_title(void *data);
|
||||||
#else
|
#else
|
||||||
float cocoa_screen_get_native_scale(void);
|
float cocoa_screen_get_native_scale(void);
|
||||||
#endif
|
#endif
|
||||||
|
@ -437,3 +437,22 @@ CocoaView *cocoaview_get(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OSX
|
||||||
|
void cocoa_update_title(void *data)
|
||||||
|
{
|
||||||
|
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||||
|
|
||||||
|
if (window)
|
||||||
|
{
|
||||||
|
char title[128];
|
||||||
|
|
||||||
|
title[0] = '\0';
|
||||||
|
|
||||||
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
|
|
||||||
|
if (title[0])
|
||||||
|
window->set_title((void*)video_driver_display_userdata_get(), title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user