summaryrefslogtreecommitdiff
path: root/macosx
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-04-22 16:54:55 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-04-22 16:54:55 +0200
commit1ecff578295a44cd33e476acf9960d989e65b99b (patch)
tree820b2769560b0460d188482dbd660639cacefd2f /macosx
parent9ff9d0edb55bcf15eb030b96f57cc6d5c63b8c5c (diff)
downloadqtlocation-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.mm38
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];
- }
-}
-
-}