mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Added drop reporting to events test.
This commit is contained in:
parent
cd54dc84c4
commit
ed4c8b27f1
@ -381,6 +381,14 @@ static void char_callback(GLFWwindow* window, unsigned int codepoint)
|
|||||||
get_character_string(codepoint));
|
get_character_string(codepoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void drop_callback(GLFWwindow* window, const char* descriptor)
|
||||||
|
{
|
||||||
|
printf("%08x at %0.3f: Drop of \"%s\" input\n",
|
||||||
|
counter++,
|
||||||
|
glfwGetTime(),
|
||||||
|
descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
void monitor_callback(GLFWmonitor* monitor, int event)
|
void monitor_callback(GLFWmonitor* monitor, int event)
|
||||||
{
|
{
|
||||||
if (event == GLFW_CONNECTED)
|
if (event == GLFW_CONNECTED)
|
||||||
@ -457,6 +465,7 @@ int main(int argc, char** argv)
|
|||||||
glfwSetScrollCallback(window, scroll_callback);
|
glfwSetScrollCallback(window, scroll_callback);
|
||||||
glfwSetKeyCallback(window, key_callback);
|
glfwSetKeyCallback(window, key_callback);
|
||||||
glfwSetCharCallback(window, char_callback);
|
glfwSetCharCallback(window, char_callback);
|
||||||
|
glfwSetDropCallback(window, drop_callback);
|
||||||
|
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
glfwSwapInterval(1);
|
glfwSwapInterval(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user