diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2014-02-07 11:40:15 -0500 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2014-02-07 11:40:15 -0500 |
commit | daac03f5269b0c000ca06db56e65118238b92bd7 (patch) | |
tree | e4abd441e53c65b93e56e7ee2be03174c242c2b8 /macosx | |
parent | b17698579125cacaddb9b16e7cab4226b8f24094 (diff) | |
download | qtlocation-mapboxgl-daac03f5269b0c000ca06db56e65118238b92bd7.tar.gz |
fixes #43: fix tile renders on OS X
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/main.mm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/macosx/main.mm b/macosx/main.mm index 1c12b7f3cf..b8f333ba23 100644 --- a/macosx/main.mm +++ b/macosx/main.mm @@ -7,6 +7,8 @@ #include <thread> +NSString *const MBXNeedsRenderNotification = @"MBXNeedsRenderNotification"; + class MapView { public: MapView() : @@ -53,6 +55,14 @@ public: glfwSetScrollCallback(window, scroll); glfwSetCharCallback(window, character); glfwSetKeyCallback(window, key); + + [[NSNotificationCenter defaultCenter] addObserverForName:MBXNeedsRenderNotification + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification *notification) + { + dirty = true; + }]; } static void character(GLFWwindow *window, unsigned int codepoint) { @@ -241,6 +251,7 @@ void request_http(std::string url, std::function<void(Response&)> func) { Response res; func(res); } + [[NSNotificationCenter defaultCenter] postNotificationName:MBXNeedsRenderNotification object:nil]; }]; } @@ -263,6 +274,7 @@ void request_http(std::string url, std::function<void(Response&)> func, std::fun func(res); cb(); + [[NSNotificationCenter defaultCenter] postNotificationName:MBXNeedsRenderNotification object:nil]; }]; } |