mirror of
https://github.com/libretro/RetroArch
synced 2025-02-23 15:40:35 +00:00
Add get_proc_address to OSX/iOS.
This commit is contained in:
parent
c19bdc7c2c
commit
c5e7de7391
@ -273,6 +273,20 @@ void apple_get_game_view_size(unsigned *width, unsigned *height)
|
||||
*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
|
||||
void apple_bind_game_view_fbo(void)
|
||||
{
|
||||
|
@ -18,6 +18,7 @@
|
||||
#define __RARCH_APPLE_H
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import "RAModuleInfo.h"
|
||||
|
||||
void apple_run_core(RAModuleInfo* core, const char* file);
|
||||
|
@ -29,6 +29,7 @@ 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);
|
||||
void *apple_get_proc_address(const char *symbol_name);
|
||||
|
||||
#ifdef IOS
|
||||
void apple_bind_game_view_fbo(void);
|
||||
|
@ -93,6 +93,11 @@ static void gfx_ctx_input_driver(const input_driver_t **input, void **input_data
|
||||
*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
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_apple = {
|
||||
@ -109,7 +114,7 @@ const gfx_ctx_driver_t gfx_ctx_apple = {
|
||||
gfx_ctx_has_focus,
|
||||
apple_flip_game_view,
|
||||
gfx_ctx_input_driver,
|
||||
NULL,
|
||||
gfx_ctx_get_proc_address,
|
||||
NULL,
|
||||
"ios",
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user