summaryrefslogtreecommitdiff
path: root/platform/default/glfw_view.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/default/glfw_view.cpp')
-rw-r--r--platform/default/glfw_view.cpp26
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;