Fix joystick test attention request

Fixes #1020.
This commit is contained in:
Camilla Löwy 2017-05-22 15:16:47 +02:00
parent 186d03b32a
commit bc7ebc1a89

View File

@ -105,14 +105,6 @@ int main(void)
if (!glfwInit()) if (!glfwInit())
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++)
{
if (glfwJoystickPresent(jid))
joystick_callback(jid, GLFW_CONNECTED);
}
glfwSetJoystickCallback(joystick_callback);
window = glfwCreateWindow(640, 480, "Joystick Test", NULL, NULL); window = glfwCreateWindow(640, 480, "Joystick Test", NULL, NULL);
if (!window) if (!window)
{ {
@ -128,6 +120,14 @@ int main(void)
nk_glfw3_font_stash_begin(&atlas); nk_glfw3_font_stash_begin(&atlas);
nk_glfw3_font_stash_end(); nk_glfw3_font_stash_end();
for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++)
{
if (glfwJoystickPresent(jid))
joysticks[joystick_count++] = jid;
}
glfwSetJoystickCallback(joystick_callback);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
int i, width, height; int i, width, height;