mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Cleanup
This commit is contained in:
parent
9689f7b925
commit
a2867ff6ea
27
src/window.c
27
src/window.c
@ -40,28 +40,23 @@
|
||||
|
||||
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused)
|
||||
{
|
||||
if (focused)
|
||||
{
|
||||
if (window->callbacks.focus)
|
||||
window->callbacks.focus((GLFWwindow*) window, focused);
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
if (window->callbacks.focus)
|
||||
window->callbacks.focus((GLFWwindow*) window, focused);
|
||||
|
||||
if (window->callbacks.focus)
|
||||
window->callbacks.focus((GLFWwindow*) window, focused);
|
||||
if (!focused)
|
||||
{
|
||||
int key, button;
|
||||
|
||||
for (i = 0; i <= GLFW_KEY_LAST; i++)
|
||||
for (key = 0; key <= GLFW_KEY_LAST; key++)
|
||||
{
|
||||
if (window->keys[i] == GLFW_PRESS)
|
||||
_glfwInputKey(window, i, 0, GLFW_RELEASE, 0);
|
||||
if (window->keys[key] == GLFW_PRESS)
|
||||
_glfwInputKey(window, key, 0, GLFW_RELEASE, 0);
|
||||
}
|
||||
|
||||
for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++)
|
||||
for (button = 0; button <= GLFW_MOUSE_BUTTON_LAST; button++)
|
||||
{
|
||||
if (window->mouseButtons[i] == GLFW_PRESS)
|
||||
_glfwInputMouseClick(window, i, GLFW_RELEASE, 0);
|
||||
if (window->mouseButtons[button] == GLFW_PRESS)
|
||||
_glfwInputMouseClick(window, button, GLFW_RELEASE, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user