(Apple) Move some code to apple_gfx_context.c.inl

This commit is contained in:
twinaphex 2014-10-03 20:19:04 +02:00
parent 476a759b14
commit e6e3a01966
2 changed files with 21 additions and 18 deletions

View File

@ -33,9 +33,6 @@
#define APP_HAS_FOCUS ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive)
#define GLContextClass EAGLContext
#define GLAPIType GFX_CTX_OPENGL_ES_API
#define GLFrameworkID CFSTR("com.apple.opengles")
#define RAScreen UIScreen
@interface EAGLContext (OSXCompat) @end
@implementation EAGLContext (OSXCompat)
@ -47,9 +44,6 @@
#define APP_HAS_FOCUS ([NSApp isActive])
#define GLContextClass NSOpenGLContext
#define GLAPIType GFX_CTX_OPENGL_API
#define GLFrameworkID CFSTR("com.apple.opengl")
#define RAScreen NSScreen
#define g_view g_instance // < RAGameView is a container on iOS; on OSX these are both the same object
@ -77,8 +71,6 @@ static UIView *g_pause_indicator_view;
static RAGameView* g_instance;
static GLContextClass* g_context;
static GLContextClass* g_hw_ctx;
@implementation RAGameView
+ (RAGameView*)get
@ -222,19 +214,10 @@ static GLContextClass* g_hw_ctx;
@end
#ifdef IOS
void apple_bind_game_view_fbo(void)
{
if (g_context)
[g_view bindDrawable];
}
#ifdef HAVE_CAMERA
#if defined(HAVE_CAMERA) && defined(IOS)
#include "apple_camera_ios.c.inl"
#endif
#endif
#ifdef HAVE_LOCATION
#include "apple_location.c.inl"
#endif

View File

@ -2,6 +2,18 @@
#include "../../gfx/gfx_context.h"
#include "../../gfx/gl_common.h"
#ifdef IOS
#define GLAPIType GFX_CTX_OPENGL_ES_API
#define GLFrameworkID CFSTR("com.apple.opengles")
#define RAScreen UIScreen
#else
#define GLAPIType GFX_CTX_OPENGL_API
#define GLFrameworkID CFSTR("com.apple.opengl")
#define RAScreen NSScreen
#endif
static GLContextClass* g_hw_ctx;
static int g_fast_forward_skips;
static bool g_is_syncing = true;
static bool g_use_hw_ctx;
@ -14,6 +26,14 @@ static NSOpenGLPixelFormat* g_format;
static unsigned g_minor = 0;
static unsigned g_major = 0;
#ifdef IOS
void apple_bind_game_view_fbo(void)
{
if (g_context)
[g_view bindDrawable];
}
#endif
static RAScreen* get_chosen_screen(void)
{
#if defined(OSX) && !defined(MAC_OS_X_VERSION_10_6)