Clarified character callback parameter.

This commit is contained in:
Camilla Berglund
2013-10-10 19:41:56 +02:00
parent 7dd8770e6f
commit 2c920fbb8b
4 changed files with 11 additions and 11 deletions
+5 -5
View File
@@ -228,12 +228,12 @@ static const char* get_mods_name(int mods)
return name;
}
static const char* get_character_string(int character)
static const char* get_character_string(int codepoint)
{
// This assumes UTF-8, which is stupid
static char result[6 + 1];
int length = wctomb(result, character);
int length = wctomb(result, codepoint);
if (length == -1)
length = 0;
@@ -372,13 +372,13 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
}
}
static void char_callback(GLFWwindow* window, unsigned int character)
static void char_callback(GLFWwindow* window, unsigned int codepoint)
{
printf("%08x at %0.3f: Character 0x%08x (%s) input\n",
counter++,
glfwGetTime(),
character,
get_character_string(character));
codepoint,
get_character_string(codepoint));
}
void monitor_callback(GLFWmonitor* monitor, int event)