diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-02-12 06:07:27 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-02-12 06:07:27 +0000 |
| commit | 4effe027896a64d1db24c46aff96bb5e09b67c8d (patch) | |
| tree | 1d6621c96fd94799d6e1ccf9b8c19f5f5a233e4d /Common/NativeApp/Apple | |
| parent | Removed unused Apple source from Unity emulator (diff) | |
| download | DiligentEngine-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.m | 18 |
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) |
