mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-03-01 08:06:04 +00:00
(Cocoa) Implement ui_window_cocoa_set_title
This commit is contained in:
parent
7a564720fb
commit
860fb1d525
@ -76,6 +76,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOATOUCH)
|
||||
|
||||
static GLKView *g_view;
|
||||
UIView *g_pause_indicator_view;
|
||||
#endif
|
||||
@ -88,6 +89,7 @@ static bool g_is_syncing = true;
|
||||
static bool g_use_hw_ctx;
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
#include "../../ui/drivers/cocoa/ui_cocoa_window.h"
|
||||
static NSOpenGLPixelFormat* g_format;
|
||||
|
||||
void *glcontext_get_ptr(void)
|
||||
@ -419,10 +421,11 @@ static void cocoagl_gfx_ctx_update_window_title(void *data)
|
||||
(void)got_text;
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
|
||||
static const char* const text = buf; /* < Can't access buffer directly in the block */
|
||||
ui_window_cocoa_t view;
|
||||
view.data = (CocoaView*)nsview_get_ptr();
|
||||
|
||||
if (got_text)
|
||||
[[g_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]];
|
||||
ui_window_cocoa_set_title(&view, buf);
|
||||
#endif
|
||||
if (settings->fps_show)
|
||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||
|
@ -89,8 +89,6 @@ void get_ios_version(int *major, int *minor);
|
||||
#elif defined(HAVE_COCOA)
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include "ui_cocoa_window.h"
|
||||
|
||||
@interface CocoaView : NSView
|
||||
#ifdef HAVE_CORELOCATION
|
||||
<CLLocationManagerDelegate>
|
||||
|
@ -23,13 +23,15 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "cocoa_common.h"
|
||||
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct ui_window_cocoa
|
||||
{
|
||||
void *empty;
|
||||
CocoaView *data;
|
||||
} ui_window_cocoa_t;
|
||||
|
||||
void ui_window_cocoa_set_visible(void *data,
|
||||
|
@ -37,6 +37,10 @@ void ui_window_cocoa_set_visible(void *data,
|
||||
|
||||
void ui_window_cocoa_set_title(void *data, char *buf)
|
||||
{
|
||||
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
|
||||
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
|
||||
const char* const text = buf; /* < Can't access buffer directly in the block */
|
||||
[[cocoa_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_cocoa = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user