Merge branch 'master' into showwindow

Conflicts:
	src/window.c
This commit is contained in:
Camilla Berglund
2012-09-06 15:11:50 +02:00
21 changed files with 88 additions and 2109 deletions
+31 -20
View File
@@ -119,6 +119,32 @@ static void list_extensions(int major, int minor)
putchar('\n');
}
static GLboolean valid_version(void)
{
int major, minor, revision;
glfwGetVersion(&major, &minor, &revision);
printf("GLFW header version: %u.%u.%u\n",
GLFW_VERSION_MAJOR,
GLFW_VERSION_MINOR,
GLFW_VERSION_REVISION);
printf("GLFW library version: %u.%u.%u\n", major, minor, revision);
if (major != GLFW_VERSION_MAJOR)
{
printf("*** ERROR: GLFW major version mismatch! ***\n");
return GL_FALSE;
}
if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION)
printf("*** WARNING: GLFW version mismatch! ***\n");
printf("GLFW library version string: \"%s\"\n", glfwGetVersionString());
return GL_TRUE;
}
int main(int argc, char** argv)
{
int ch, profile = 0, strategy = 0, major = 1, minor = 0, revision;
@@ -126,6 +152,9 @@ int main(int argc, char** argv)
GLint flags, mask;
GLFWwindow window;
if (!valid_version())
exit(EXIT_FAILURE);
while ((ch = getopt(argc, argv, "dfhlm:n:p:r:")) != -1)
{
switch (ch)
@@ -181,6 +210,8 @@ int main(int argc, char** argv)
argc -= optind;
argv += optind;
// Initialize GLFW and create window
glfwSetErrorCallback(error_callback);
if (!glfwInit())
@@ -218,26 +249,6 @@ int main(int argc, char** argv)
glfwMakeContextCurrent(window);
// Report GLFW version
glfwGetVersion(&major, &minor, &revision);
printf("GLFW header version: %u.%u.%u\n",
GLFW_VERSION_MAJOR,
GLFW_VERSION_MINOR,
GLFW_VERSION_REVISION);
printf("GLFW library version: %u.%u.%u\n", major, minor, revision);
if (major != GLFW_VERSION_MAJOR ||
minor != GLFW_VERSION_MINOR ||
revision != GLFW_VERSION_REVISION)
{
printf("*** WARNING: GLFW version mismatch! ***\n");
}
printf("GLFW library version string: \"%s\"\n", glfwGetVersionString());
// Report OpenGL version
printf("OpenGL context version string: \"%s\"\n", glGetString(GL_VERSION));
+1 -1
View File
@@ -137,7 +137,7 @@ static void refresh_joysticks(void)
j->axes = realloc(j->axes, j->axis_count * sizeof(float));
}
glfwGetJoystickPos(GLFW_JOYSTICK_1 + i, j->axes, j->axis_count);
glfwGetJoystickAxes(GLFW_JOYSTICK_1 + i, j->axes, j->axis_count);
button_count = glfwGetJoystickParam(GLFW_JOYSTICK_1 + i, GLFW_BUTTONS);
if (button_count != j->button_count)