diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-04-22 16:54:55 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-04-22 16:54:55 +0200 |
commit | 1ecff578295a44cd33e476acf9960d989e65b99b (patch) | |
tree | 820b2769560b0460d188482dbd660639cacefd2f /macosx | |
parent | 9ff9d0edb55bcf15eb030b96f57cc6d5c63b8c5c (diff) | |
download | qtlocation-mapboxgl-1ecff578295a44cd33e476acf9960d989e65b99b.tar.gz |
use libuv event loop in the glfw view
Integrates libuv's default loop with GLFW's glfwWaitEvents() call. See https://github.com/joyent/libuv/issues/1246 for more details on integrating event loops.
fixes #149
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/main.mm | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/macosx/main.mm b/macosx/main.mm index c6cc04d843..8d2b0d8ce9 100644 --- a/macosx/main.mm +++ b/macosx/main.mm @@ -1,40 +1,14 @@ -#import <Foundation/Foundation.h> -#import <AppKit/AppKit.h> +// #import <Foundation/Foundation.h> +// #import <AppKit/AppKit.h> #include "settings.hpp" #include "../common/glfw_view.hpp" -#include <cstdio> - -#include <thread> - -MapView *mapView = nullptr; - int main() { llmr::Settings_MacOSX settings; - mapView = new MapView(settings); - mapView->init(); - int ret = mapView->run(); - mapView->settings.sync(); - delete mapView; + MapView view(settings); + view.init(); + int ret = view.run(); + settings.sync(); return ret; } - - - -namespace llmr { - -void platform::cleanup() { - // noop -} - -void platform::restart() { - if (mapView) { - mapView->dirty = true; - CGEventRef event = CGEventCreate(NULL); - CGEventSetType(event, kCGEventMouseMoved); - [[NSApplication sharedApplication] postEvent: [NSEvent eventWithCGEvent:event] atStart:NO]; - } -} - -} |