Cast to NSOpenGLContext *

This commit is contained in:
twinaphex 2016-02-26 13:39:01 +01:00
parent dcefb740f2
commit 4dfed7e930
2 changed files with 14 additions and 4 deletions

View File

@ -90,7 +90,7 @@ static NSOpenGLPixelFormat* g_format;
static unsigned g_minor = 0;
static unsigned g_major = 0;
GLContextClass *glcontext_get_ptr(void)
void *glcontext_get_ptr(void)
{
return g_context;
}

View File

@ -37,7 +37,9 @@
static id apple_platform;
/* forward declaration */
GLContextClass *glcontext_get_ptr(void);
#ifdef HAVE_OPENGL
void *glcontext_get_ptr(void);
#endif
void apple_rarch_exited(void)
{
@ -350,7 +352,9 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result)
}
- (IBAction)openCore:(id)sender {
GLContextClass *glc = glcontext_get_ptr();
#ifdef HAVE_OPENGL
GLContextClass *glc = (NSOpenGLContext*)glcontext_get_ptr();
#endif
NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel];
settings_t *settings = config_get_ptr();
NSString *startdir = BOXSTRING(settings->libretro_directory);
@ -376,12 +380,16 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result)
if (result == 1)
open_core_handler(panel, result);
#endif
#ifdef HAVE_OPENGL
[glc makeCurrentContext];
#endif
}
- (void)openDocument:(id)sender
{
GLContextClass *glc = glcontext_get_ptr();
#ifdef HAVE_OPENGL
GLContextClass *glc = (NSOpenGLContext*)glcontext_get_ptr();
#endif
NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel];
settings_t *settings = config_get_ptr();
NSString *startdir = BOXSTRING(settings->menu_content_directory);
@ -408,7 +416,9 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result)
if (result == 1)
open_document_handler(panel, result);
#endif
#ifdef HAVE_OPENGL
[glc makeCurrentContext];
#endif
}
- (void)unloadingCore