mirror of
https://github.com/encounter/SDL.git
synced 2025-12-09 05:27:48 +00:00
Enable SDL_LoadObject on iOS 8+ and tvOS.
This commit is contained in:
@@ -30,11 +30,25 @@
|
||||
|
||||
#include "SDL_loadso.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_UIKIT
|
||||
#include "../../video/uikit/SDL_uikitvideo.h"
|
||||
#endif
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
void *handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL);
|
||||
const char *loaderror = (char *) dlerror();
|
||||
void *handle;
|
||||
const char *loaderror;
|
||||
|
||||
#if SDL_VIDEO_DRIVER_UIKIT
|
||||
if (!UIKit_IsSystemVersionAtLeast(8.0)) {
|
||||
SDL_SetError("SDL_LoadObject requires iOS 8+");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL);
|
||||
loaderror = (char *) dlerror();
|
||||
if (handle == NULL) {
|
||||
SDL_SetError("Failed loading %s: %s", sofile, loaderror);
|
||||
}
|
||||
|
||||
@@ -21,20 +21,25 @@
|
||||
#ifndef _SDL_uikitvideo_h
|
||||
#define _SDL_uikitvideo_h
|
||||
|
||||
#include <UIKit/UIKit.h>
|
||||
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
#ifdef __OBJC__
|
||||
|
||||
#include <UIKit/UIKit.h>
|
||||
|
||||
@interface SDL_VideoData : NSObject
|
||||
|
||||
@property (nonatomic) id pasteboardObserver;
|
||||
|
||||
@end
|
||||
|
||||
CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen);
|
||||
|
||||
#endif /* __OBJC__ */
|
||||
|
||||
void UIKit_SuspendScreenSaver(_THIS);
|
||||
|
||||
BOOL UIKit_IsSystemVersionAtLeast(double version);
|
||||
CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen);
|
||||
SDL_bool UIKit_IsSystemVersionAtLeast(double version);
|
||||
|
||||
#endif /* _SDL_uikitvideo_h */
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ UIKit_SuspendScreenSaver(_THIS)
|
||||
}
|
||||
}
|
||||
|
||||
BOOL
|
||||
SDL_bool
|
||||
UIKit_IsSystemVersionAtLeast(double version)
|
||||
{
|
||||
return [[UIDevice currentDevice].systemVersion doubleValue] >= version;
|
||||
|
||||
Reference in New Issue
Block a user