summaryrefslogtreecommitdiffstats
path: root/Common/NativeApp/Apple
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-02-12 06:07:27 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-02-12 06:07:27 +0000
commit4effe027896a64d1db24c46aff96bb5e09b67c8d (patch)
tree1d6621c96fd94799d6e1ccf9b8c19f5f5a233e4d /Common/NativeApp/Apple
parentRemoved unused Apple source from Unity emulator (diff)
downloadDiligentEngine-4effe027896a64d1db24c46aff96bb5e09b67c8d.tar.gz
DiligentEngine-4effe027896a64d1db24c46aff96bb5e09b67c8d.zip
Enabled iOS build; unified target platform app generation in cmake
Diffstat (limited to 'Common/NativeApp/Apple')
-rw-r--r--Common/NativeApp/Apple/Source/Classes/iOS/EAGLView.m18
1 files changed, 10 insertions, 8 deletions
diff --git a/Common/NativeApp/Apple/Source/Classes/iOS/EAGLView.m b/Common/NativeApp/Apple/Source/Classes/iOS/EAGLView.m
index e361cf2..42cb38d 100644
--- a/Common/NativeApp/Apple/Source/Classes/iOS/EAGLView.m
+++ b/Common/NativeApp/Apple/Source/Classes/iOS/EAGLView.m
@@ -8,12 +8,12 @@
#import "EAGLView.h"
-#include "Renderer.h"
+#include "NativeAppBase.h"
#include <memory>
@interface EAGLView ()
{
- std::unique_ptr<Renderer> _renderer;
+ std::unique_ptr<NativeAppBase> _theApp;
EAGLContext* _context;
NSInteger _animationFrameInterval;
CADisplayLink* _displayLink;
@@ -48,11 +48,11 @@
return nil;
}
- _renderer.reset(new Renderer());
+ _theApp.reset(CreateApplication());
// Init our renderer.
- _renderer->Init((__bridge void*)self.layer);
+ _theApp->OnGLContextCreated((__bridge void*)self.layer);
- if (!_renderer)
+ if (!_theApp)
{
return nil;
}
@@ -68,12 +68,14 @@
- (void) drawView:(id)sender
{
[EAGLContext setCurrentContext:_context];
- _renderer->Render();
+ _theApp->Update();
+ _theApp->Render();
+ _theApp->Present();
}
- (void) layoutSubviews
{
- _renderer->WindowResize(0, 0);
+ _theApp->WindowResize(0, 0);
[self drawView:nil];
}
@@ -131,7 +133,7 @@
- (void) dealloc
{
- _renderer.reset();
+ _theApp.reset();
// tear down context
if ([EAGLContext currentContext] == _context)