diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-04-14 18:48:11 -0400 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-04-14 18:50:17 -0400 |
commit | f18aa61e33e3dc9dd0723e3fc8609533742ff98b (patch) | |
tree | b02aeaa67f6740a1b7eab8bf77c4d8a284f3853b /common | |
parent | 305e688a3a1d255fe34269cc327284275a0a3044 (diff) | |
download | qtlocation-mapboxgl-f18aa61e33e3dc9dd0723e3fc8609533742ff98b.tar.gz |
derive from GLKViewController
this handles resizing the view/framebuffer much better
fixes #130, #131, #133, #118
Diffstat (limited to 'common')
-rw-r--r-- | common/foundation_request.h | 4 | ||||
-rw-r--r-- | common/foundation_request.mm | 7 | ||||
-rw-r--r-- | common/map_view.cpp | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/common/foundation_request.h b/common/foundation_request.h new file mode 100644 index 0000000000..70c383aa85 --- /dev/null +++ b/common/foundation_request.h @@ -0,0 +1,4 @@ +#import <Foundation/Foundation.h> + +NSString *const MBXNeedsRenderNotification = @"MBXNeedsRenderNotification"; +NSString *const MBXUpdateActivityNotification = @"MBXUpdateActivityNotification"; diff --git a/common/foundation_request.mm b/common/foundation_request.mm index d7ab26cefa..eb662a8de7 100644 --- a/common/foundation_request.mm +++ b/common/foundation_request.mm @@ -1,4 +1,5 @@ -#import <Foundation/Foundation.h> +#import "foundation_request.h" + #include <memory> #include <string> #include <functional> @@ -29,6 +30,7 @@ platform::request_http(const std::string &url, std::function<void(Response *)> b if ([error code] == NSURLErrorCancelled) { // We intentionally cancelled this request. Do nothing. + [[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil]; return; } @@ -46,11 +48,14 @@ platform::request_http(const std::string &url, std::function<void(Response *)> b dispatch_async(dispatch_get_main_queue(), ^(void) { foreground_callback(); + + [[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil]; }); }]; req = std::make_shared<Request>(task, url); [task resume]; + [[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil]; return req; } diff --git a/common/map_view.cpp b/common/map_view.cpp index 39a48a07a7..162060950b 100644 --- a/common/map_view.cpp +++ b/common/map_view.cpp @@ -234,7 +234,7 @@ public: namespace llmr { namespace platform { -double time() { +double elapsed() { return glfwGetTime(); } |