mirror of
https://github.com/glfw/glfw.git
synced 2024-11-14 10:34:34 +00:00
Add attention request to joystick test
This commit is contained in:
parent
baa9cd8968
commit
2f5e230338
@ -52,6 +52,7 @@
|
|||||||
#define strdup(x) _strdup(x)
|
#define strdup(x) _strdup(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static GLFWwindow* window;
|
||||||
static int joysticks[GLFW_JOYSTICK_LAST + 1];
|
static int joysticks[GLFW_JOYSTICK_LAST + 1];
|
||||||
static int joystick_count = 0;
|
static int joystick_count = 0;
|
||||||
|
|
||||||
@ -79,6 +80,9 @@ static void joystick_callback(int jid, int event)
|
|||||||
|
|
||||||
joystick_count--;
|
joystick_count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!glfwGetWindowAttrib(window, GLFW_FOCUSED))
|
||||||
|
glfwRequestWindowAttention(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* joystick_label(int jid)
|
static const char* joystick_label(int jid)
|
||||||
@ -91,7 +95,6 @@ static const char* joystick_label(int jid)
|
|||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
int jid, hat_buttons = GLFW_FALSE;
|
int jid, hat_buttons = GLFW_FALSE;
|
||||||
GLFWwindow* window;
|
|
||||||
struct nk_context* nk;
|
struct nk_context* nk;
|
||||||
struct nk_font_atlas* atlas;
|
struct nk_font_atlas* atlas;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user