mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
(Apple) On OSX, a call to apple_run_core will actaully run the game
This commit is contained in:
parent
99ba3ccea3
commit
3d9d672a38
@ -183,6 +183,8 @@ bool apple_init_game_view()
|
||||
});
|
||||
|
||||
[EAGLContext setCurrentContext:g_context];
|
||||
#else
|
||||
[g_context makeCurrentContext];
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
@ -205,6 +207,8 @@ void apple_destroy_game_view()
|
||||
});
|
||||
|
||||
[EAGLContext setCurrentContext:nil];
|
||||
#else
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -239,14 +243,12 @@ void apple_get_game_view_size(unsigned *width, unsigned *height)
|
||||
*height = *height ? *height : 480;
|
||||
}
|
||||
|
||||
#ifdef IOS
|
||||
void apple_bind_game_view_fbo(void)
|
||||
{
|
||||
#ifdef IOS
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
if (g_context)
|
||||
[g_view bindDrawable];
|
||||
});
|
||||
#else
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
@ -98,13 +98,13 @@ void apple_run_core(RAModuleInfo* core, const char* file)
|
||||
memset(load_data, 0, sizeof(struct rarch_main_wrap));
|
||||
|
||||
#ifdef IOS
|
||||
// load_data->sram_path = strdup(self.systemDirectory.UTF8String);
|
||||
// load_data->state_path = strdup(self.systemDirectory.UTF8String);
|
||||
load_data->sram_path = strdup(RetroArch_iOS.get.systemDirectory.UTF8String);
|
||||
load_data->state_path = strdup(RetroArch_iOS.get.systemDirectory.UTF8String);
|
||||
#endif
|
||||
|
||||
if (file && core)
|
||||
{
|
||||
load_data->libretro_path = strdup(apple_core.path.UTF8String);
|
||||
load_data->libretro_path = strdup("/Users/jason/Desktop/libretro.dylib");
|
||||
load_data->rom_path = strdup(file);
|
||||
#ifdef IOS
|
||||
load_data->config_path = strdup(apple_core.configPath.UTF8String);
|
||||
@ -134,14 +134,7 @@ void apple_rarch_exited(void* result)
|
||||
if (apple_is_running)
|
||||
{
|
||||
[apple_platform unloadingCore:apple_core];
|
||||
|
||||
apple_is_running = false;
|
||||
|
||||
//
|
||||
// [self popToViewController:[RAGameView get] animated:NO];
|
||||
// [self popViewControllerAnimated:NO];
|
||||
|
||||
// btpad_set_inquiry_state(true);
|
||||
}
|
||||
|
||||
apple_core = nil;
|
||||
@ -493,7 +486,7 @@ int main(int argc, char *argv[])
|
||||
[window.contentView setAutoresizesSubviews:YES];
|
||||
|
||||
RAGameView.get.frame = [window.contentView bounds];
|
||||
[window.contentView addSubview:RAGameView.get];
|
||||
[window.contentView addSubview:RAGameView.get];
|
||||
}
|
||||
|
||||
#pragma mark RetroArch_Platform
|
||||
|
@ -29,7 +29,10 @@ void apple_destroy_game_view(void);
|
||||
void apple_flip_game_view(void);
|
||||
void apple_set_game_view_sync(unsigned interval);
|
||||
void apple_get_game_view_size(unsigned *width, unsigned *height);
|
||||
|
||||
#ifdef IOS
|
||||
void apple_bind_game_view_fbo(void);
|
||||
#endif
|
||||
|
||||
void ios_add_log_message(const char* format, ...);
|
||||
|
||||
|
@ -68,6 +68,8 @@ char* ios_get_rarch_system_directory()
|
||||
return strdup([RetroArch_iOS.get.systemDirectory UTF8String]);
|
||||
}
|
||||
|
||||
#include "../iOS/views.h"
|
||||
|
||||
// Simple class to reduce code duplication for fixed table views
|
||||
@implementation RATableViewController
|
||||
|
||||
|
@ -277,6 +277,7 @@
|
||||
"-DHAVE_ZLIB",
|
||||
"-DWANT_MINIZ",
|
||||
"-DSINC_LOWER_QUALITY",
|
||||
"-DHAVE_NULLINPUT",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
@ -332,6 +333,7 @@
|
||||
"-DHAVE_ZLIB",
|
||||
"-DWANT_MINIZ",
|
||||
"-DSINC_LOWER_QUALITY",
|
||||
"-DHAVE_NULLINPUT",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
|
@ -29,7 +29,11 @@
|
||||
|
||||
static bool gfx_ctx_bind_api(enum gfx_ctx_api api)
|
||||
{
|
||||
#ifdef IOS
|
||||
return api == GFX_CTX_OPENGL_ES_API;
|
||||
#else
|
||||
return api == GFX_CTX_OPENGL_API;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool gfx_ctx_set_video_mode(
|
@ -48,15 +48,12 @@ static const gfx_ctx_driver_t *gfx_ctx_drivers[] = {
|
||||
#if defined(__BLACKBERRY_QNX__)
|
||||
&gfx_ctx_bbqnx,
|
||||
#endif
|
||||
#if defined(IOS)
|
||||
#if defined(IOS) || defined(OSX) //< Don't use __APPLE__ as it breaks basic SDL builds
|
||||
&gfx_ctx_ios,
|
||||
#endif
|
||||
#if defined(HAVE_SDL) && defined(HAVE_OPENGL)
|
||||
&gfx_ctx_sdl_gl,
|
||||
#endif
|
||||
#if defined(IS_XCODE) && defined(__APPLE__)
|
||||
&gfx_ctx_null,
|
||||
#endif
|
||||
};
|
||||
|
||||
const gfx_ctx_driver_t *gfx_ctx_find_driver(const char *ident)
|
||||
|
@ -107,8 +107,8 @@ VIDEO CONTEXT
|
||||
#include "../gfx/context/androidegl_ctx.c"
|
||||
#elif defined(__BLACKBERRY_QNX__)
|
||||
#include "../gfx/context/bbqnx_ctx.c"
|
||||
#elif defined(IOS)
|
||||
#include "../gfx/context/ioseagl_ctx.c"
|
||||
#elif defined(IOS) || defined(OSX) //< Don't use __APPLE__ as it breaks basic SDL builds
|
||||
#include "../gfx/context/apple_gl_ctx.c"
|
||||
#elif defined(GEKKO)
|
||||
// none
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user