Add get_proc_address to OSX/iOS.

This commit is contained in:
Themaister 2013-08-11 14:10:10 +02:00 committed by twinaphex
parent c19bdc7c2c
commit c5e7de7391
4 changed files with 22 additions and 1 deletions

View File

@ -273,6 +273,20 @@ void apple_get_game_view_size(unsigned *width, unsigned *height)
*height = *height ? *height : 480; *height = *height ? *height : 480;
} }
void *apple_get_proc_address(const char *symbol_name)
{
#ifdef IOS
(void)symbol_name; // We don't need symbols above GLES2 on iOS.
return NULL;
#else
CFStringRef symbol = CFStringCreateWithCString(kCFAllocatorDefault, symbol_name, kCFStringEncodingASCII);
void *proc = CFBundleGetFunctionPointerForName(CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl")),
symbol);
CFRelease(symbol);
return proc;
#endif
}
#ifdef IOS #ifdef IOS
void apple_bind_game_view_fbo(void) void apple_bind_game_view_fbo(void)
{ {

View File

@ -18,6 +18,7 @@
#define __RARCH_APPLE_H #define __RARCH_APPLE_H
#include <Foundation/Foundation.h> #include <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import "RAModuleInfo.h" #import "RAModuleInfo.h"
void apple_run_core(RAModuleInfo* core, const char* file); void apple_run_core(RAModuleInfo* core, const char* file);

View File

@ -29,6 +29,7 @@ void apple_destroy_game_view(void);
void apple_flip_game_view(void); void apple_flip_game_view(void);
void apple_set_game_view_sync(unsigned interval); void apple_set_game_view_sync(unsigned interval);
void apple_get_game_view_size(unsigned *width, unsigned *height); void apple_get_game_view_size(unsigned *width, unsigned *height);
void *apple_get_proc_address(const char *symbol_name);
#ifdef IOS #ifdef IOS
void apple_bind_game_view_fbo(void); void apple_bind_game_view_fbo(void);

View File

@ -93,6 +93,11 @@ static void gfx_ctx_input_driver(const input_driver_t **input, void **input_data
*input_data = NULL; *input_data = NULL;
} }
static gfx_ctx_proc_t gfx_ctx_get_proc_address(const char *symbol_name)
{
return (gfx_ctx_proc_t)apple_get_proc_address(symbol_name);
}
// The apple_* functions are implemented in apple/RetroArch/RAGameView.m // The apple_* functions are implemented in apple/RetroArch/RAGameView.m
const gfx_ctx_driver_t gfx_ctx_apple = { const gfx_ctx_driver_t gfx_ctx_apple = {
@ -109,7 +114,7 @@ const gfx_ctx_driver_t gfx_ctx_apple = {
gfx_ctx_has_focus, gfx_ctx_has_focus,
apple_flip_game_view, apple_flip_game_view,
gfx_ctx_input_driver, gfx_ctx_input_driver,
NULL, gfx_ctx_get_proc_address,
NULL, NULL,
"ios", "ios",
}; };