diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-02-05 14:58:20 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-03-06 13:52:25 +0100 |
commit | fb44fc81bdab09d079ed27e22b86718627ded48b (patch) | |
tree | 2a4e7c80eb49624c0b548d7bd33401792da1faa4 /platform/default/glfw_view.cpp | |
parent | 0151fe6c01367ef03a2ff282b90e32dd3785a7c2 (diff) | |
download | qtlocation-mapboxgl-fb44fc81bdab09d079ed27e22b86718627ded48b.tar.gz |
make Map::resize() private
they can only be called by View::resize
Diffstat (limited to 'platform/default/glfw_view.cpp')
-rw-r--r-- | platform/default/glfw_view.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 8306229d4a..865636aebf 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -62,14 +62,14 @@ void GLFWView::initialize(mbgl::Map *map_) { int width, height; glfwGetWindowSize(window, &width, &height); - resize(window, width, height); + onResize(window, width, height); - glfwSetCursorPosCallback(window, mouseMove); - glfwSetMouseButtonCallback(window, mouseClick); - glfwSetWindowSizeCallback(window, resize); - glfwSetFramebufferSizeCallback(window, resize); - glfwSetScrollCallback(window, scroll); - glfwSetKeyCallback(window, key); + glfwSetCursorPosCallback(window, onMouseMove); + glfwSetMouseButtonCallback(window, onMouseClick); + glfwSetWindowSizeCallback(window, onResize); + glfwSetFramebufferSizeCallback(window, onResize); + glfwSetScrollCallback(window, onScroll); + glfwSetKeyCallback(window, onKey); const std::string extensions = reinterpret_cast<const char *>(MBGL_CHECK_ERROR(glGetString(GL_EXTENSIONS))); { @@ -157,7 +157,7 @@ void GLFWView::initialize(mbgl::Map *map_) { glfwMakeContextCurrent(nullptr); } -void GLFWView::key(GLFWwindow *window, int key, int /*scancode*/, int action, int mods) { +void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action, int mods) { GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window)); if (action == GLFW_RELEASE) { @@ -190,7 +190,7 @@ void GLFWView::key(GLFWwindow *window, int key, int /*scancode*/, int action, in } } -void GLFWView::scroll(GLFWwindow *window, double /*xOffset*/, double yOffset) { +void GLFWView::onScroll(GLFWwindow *window, double /*xOffset*/, double yOffset) { GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window)); double delta = yOffset * 40; @@ -213,16 +213,16 @@ void GLFWView::scroll(GLFWwindow *window, double /*xOffset*/, double yOffset) { view->map->scaleBy(scale, view->lastX, view->lastY); } -void GLFWView::resize(GLFWwindow *window, int width, int height ) { +void GLFWView::onResize(GLFWwindow *window, int width, int height ) { GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window)); int fbWidth, fbHeight; glfwGetFramebufferSize(window, &fbWidth, &fbHeight); - view->map->resize(width, height, static_cast<float>(fbWidth) / static_cast<float>(width), fbWidth, fbHeight); + view->resize(width, height, static_cast<float>(fbWidth) / static_cast<float>(width), fbWidth, fbHeight); } -void GLFWView::mouseClick(GLFWwindow *window, int button, int action, int modifiers) { +void GLFWView::onMouseClick(GLFWwindow *window, int button, int action, int modifiers) { GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window)); if (button == GLFW_MOUSE_BUTTON_RIGHT || @@ -249,7 +249,7 @@ void GLFWView::mouseClick(GLFWwindow *window, int button, int action, int modifi } } -void GLFWView::mouseMove(GLFWwindow *window, double x, double y) { +void GLFWView::onMouseMove(GLFWwindow *window, double x, double y) { GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window)); if (view->tracking) { double dx = x - view->lastX; |