summaryrefslogtreecommitdiff
path: root/platform/iphone/app_delegate.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/iphone/app_delegate.mm')
-rw-r--r--platform/iphone/app_delegate.mm16
1 files changed, 14 insertions, 2 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm
index 4de321fa04..acc3e5d4e0 100644
--- a/platform/iphone/app_delegate.mm
+++ b/platform/iphone/app_delegate.mm
@@ -32,7 +32,9 @@
#include "core/project_settings.h"
#include "drivers/coreaudio/audio_driver_coreaudio.h"
+#if defined(OPENGL_ENABLED)
#import "gl_view.h"
+#endif
#include "main/main.h"
#include "os_iphone.h"
@@ -412,10 +414,12 @@ static void on_focus_in(ViewController *view_controller, bool *is_focus_out) {
OS::VideoMode _get_video_mode() {
int backingWidth;
int backingHeight;
+#if defined(OPENGL_ENABLED)
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES,
GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES,
GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
+#endif
OS::VideoMode vm;
vm.fullscreen = true;
@@ -426,7 +430,7 @@ OS::VideoMode _get_video_mode() {
};
static int frame_count = 0;
-- (void)drawView:(GLView *)view;
+- (void)drawView:(UIView *)view;
{
switch (frame_count) {
@@ -634,6 +638,7 @@ static int frame_count = 0;
return FALSE;
};
+#if defined(OPENGL_ENABLED)
// WARNING: We must *always* create the GLView after we have constructed the
// OS with iphone_main. This allows the GLView to access project settings so
// it can properly initialize the OpenGL context
@@ -642,7 +647,7 @@ static int frame_count = 0;
view_controller = [[ViewController alloc] init];
view_controller.view = glView;
- window.rootViewController = view_controller;
+
_set_keep_screen_on(bool(GLOBAL_DEF("display/window/energy_saving/keep_screen_on", true)) ? YES : NO);
glView.useCADisplayLink =
@@ -650,6 +655,13 @@ static int frame_count = 0;
printf("cadisaplylink: %d", glView.useCADisplayLink);
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
+#endif
+
+#if defined(VULKAN_ENABLED)
+ view_controller = [[ViewController alloc] init];
+#endif
+
+ window.rootViewController = view_controller;
// Show the window
[window makeKeyAndVisible];