Merge branch 'master' into cursor-enter-leave

This commit is contained in:
Camilla Berglund
2012-03-22 12:06:00 +01:00
53 changed files with 3420 additions and 1179 deletions
+14 -11
View File
@@ -40,8 +40,9 @@
#include <ctype.h>
#include <locale.h>
static GLboolean keyrepeat = 0;
static GLboolean systemkeys = 1;
static GLboolean keyrepeat = GL_FALSE;
static GLboolean systemkeys = GL_TRUE;
static GLboolean closeable = GL_TRUE;
static unsigned int counter = 0;
static const char* get_key_name(int key)
@@ -230,7 +231,7 @@ static void window_size_callback(GLFWwindow window, int width, int height)
static int window_close_callback(GLFWwindow window)
{
printf("%08x at %0.3f: Window close\n", counter++, glfwGetTime());
return 1;
return closeable;
}
static void window_refresh_callback(GLFWwindow window)
@@ -306,10 +307,7 @@ static void key_callback(GLFWwindow window, int key, int action)
case GLFW_KEY_R:
{
keyrepeat = !keyrepeat;
if (keyrepeat)
glfwEnable(window, GLFW_KEY_REPEAT);
else
glfwDisable(window, GLFW_KEY_REPEAT);
glfwSetInputMode(window, GLFW_KEY_REPEAT, keyrepeat);
printf("(( key repeat %s ))\n", keyrepeat ? "enabled" : "disabled");
break;
@@ -318,14 +316,19 @@ static void key_callback(GLFWwindow window, int key, int action)
case GLFW_KEY_S:
{
systemkeys = !systemkeys;
if (systemkeys)
glfwEnable(window, GLFW_SYSTEM_KEYS);
else
glfwDisable(window, GLFW_SYSTEM_KEYS);
glfwSetInputMode(window, GLFW_SYSTEM_KEYS, systemkeys);
printf("(( system keys %s ))\n", systemkeys ? "enabled" : "disabled");
break;
}
case GLFW_KEY_C:
{
closeable = !closeable;
printf("(( closing %s ))\n", closeable ? "enabled" : "disabled");
break;
}
}
}