|
@@ -332,7 +332,7 @@ nk_glfw3_mouse_button_callback(GLFWwindow* window, int button, int action, int m
|
|
double dt = glfwGetTime() - glfw.last_button_click;
|
|
double dt = glfwGetTime() - glfw.last_button_click;
|
|
if (dt > NK_GLFW_DOUBLE_CLICK_LO && dt < NK_GLFW_DOUBLE_CLICK_HI) {
|
|
if (dt > NK_GLFW_DOUBLE_CLICK_LO && dt < NK_GLFW_DOUBLE_CLICK_HI) {
|
|
glfw.is_double_click_down = nk_true;
|
|
glfw.is_double_click_down = nk_true;
|
|
- glfw.double_click_pos = nk_vec2(x, y);
|
|
|
|
|
|
+ glfw.double_click_pos = nk_vec2((float)x, (float)y);
|
|
}
|
|
}
|
|
glfw.last_button_click = glfwGetTime();
|
|
glfw.last_button_click = glfwGetTime();
|
|
} else glfw.is_double_click_down = nk_false;
|
|
} else glfw.is_double_click_down = nk_false;
|
|
@@ -418,7 +418,7 @@ nk_glfw3_new_frame(void)
|
|
for (i = 0; i < glfw.text_len; ++i)
|
|
for (i = 0; i < glfw.text_len; ++i)
|
|
nk_input_unicode(ctx, glfw.text[i]);
|
|
nk_input_unicode(ctx, glfw.text[i]);
|
|
|
|
|
|
-#if NK_GLFW_GL3_MOUSE_GRABBING
|
|
|
|
|
|
+#ifdef NK_GLFW_GL3_MOUSE_GRABBING
|
|
/* optional grabbing behavior */
|
|
/* optional grabbing behavior */
|
|
if (ctx->input.mouse.grab)
|
|
if (ctx->input.mouse.grab)
|
|
glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
|
glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
|
@@ -463,7 +463,7 @@ nk_glfw3_new_frame(void)
|
|
|
|
|
|
glfwGetCursorPos(win, &x, &y);
|
|
glfwGetCursorPos(win, &x, &y);
|
|
nk_input_motion(ctx, (int)x, (int)y);
|
|
nk_input_motion(ctx, (int)x, (int)y);
|
|
-#if NK_GLFW_GL3_MOUSE_GRABBING
|
|
|
|
|
|
+#ifdef NK_GLFW_GL3_MOUSE_GRABBING
|
|
if (ctx->input.mouse.grabbed) {
|
|
if (ctx->input.mouse.grabbed) {
|
|
glfwSetCursorPos(glfw.win, ctx->input.mouse.prev.x, ctx->input.mouse.prev.y);
|
|
glfwSetCursorPos(glfw.win, ctx->input.mouse.prev.x, ctx->input.mouse.prev.y);
|
|
ctx->input.mouse.pos.x = ctx->input.mouse.prev.x;
|
|
ctx->input.mouse.pos.x = ctx->input.mouse.prev.x;
|
|
@@ -473,7 +473,7 @@ nk_glfw3_new_frame(void)
|
|
nk_input_button(ctx, NK_BUTTON_LEFT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS);
|
|
nk_input_button(ctx, NK_BUTTON_LEFT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS);
|
|
nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
|
|
nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
|
|
nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
|
|
nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
|
|
- nk_input_button(ctx, NK_BUTTON_DOUBLE, glfw.double_click_pos.x, glfw.double_click_pos.y, glfw.is_double_click_down);
|
|
|
|
|
|
+ nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x, (int)glfw.double_click_pos.y, glfw.is_double_click_down);
|
|
nk_input_scroll(ctx, glfw.scroll);
|
|
nk_input_scroll(ctx, glfw.scroll);
|
|
nk_input_end(&glfw.ctx);
|
|
nk_input_end(&glfw.ctx);
|
|
glfw.text_len = 0;
|
|
glfw.text_len = 0;
|