Merge branch 'master' into multi-monitor

Conflicts:
	include/GL/glfw3.h
	src/window.c
	tests/glfwinfo.c
This commit is contained in:
Camilla Berglund
2012-12-22 19:40:15 +01:00
19 changed files with 2369 additions and 483 deletions
+47 -11
View File
@@ -77,9 +77,9 @@ static const char* get_client_api_name(int api)
static const char* get_profile_name_gl(GLint mask)
{
if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
return "compatibility";
return PROFILE_NAME_COMPAT;
if (mask & GL_CONTEXT_CORE_PROFILE_BIT)
return "core";
return PROFILE_NAME_CORE;
return "unknown";
}
@@ -87,9 +87,29 @@ static const char* get_profile_name_gl(GLint mask)
static const char* get_profile_name_glfw(int profile)
{
if (profile == GLFW_OPENGL_COMPAT_PROFILE)
return "compatibility";
return PROFILE_NAME_COMPAT;
if (profile == GLFW_OPENGL_CORE_PROFILE)
return "core";
return PROFILE_NAME_CORE;
return "unknown";
}
static const char* get_strategy_name_gl(GLint strategy)
{
if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB)
return STRATEGY_NAME_LOSE;
if (strategy == GL_NO_RESET_NOTIFICATION_ARB)
return STRATEGY_NAME_NONE;
return "unknown";
}
static const char* get_strategy_name_glfw(int strategy)
{
if (strategy == GLFW_LOSE_CONTEXT_ON_RESET)
return STRATEGY_NAME_LOSE;
if (strategy == GLFW_NO_RESET_NOTIFICATION)
return STRATEGY_NAME_NONE;
return "unknown";
}
@@ -265,9 +285,6 @@ int main(int argc, char** argv)
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
// We assume here that we stand a better chance of success by leaving all
// possible details of pixel format selection to GLFW
window = glfwCreateWindow(200, 200, "Version", NULL, NULL);
if (!window)
{
@@ -303,8 +320,10 @@ int main(int argc, char** argv)
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
printf(" forward-compatible");
if (flags & 0)
if (flags & GL_CONTEXT_FLAG_DEBUG_BIT)
printf(" debug");
if (flags & GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB)
printf(" robustness");
putchar('\n');
printf("%s context flags parsed by GLFW:", get_client_api_name(api));
@@ -313,6 +332,8 @@ int main(int argc, char** argv)
printf(" forward-compatible");
if (glfwGetWindowParam(window, GLFW_OPENGL_DEBUG_CONTEXT))
printf(" debug");
if (glfwGetWindowParam(window, GLFW_CONTEXT_ROBUSTNESS) != GLFW_NO_ROBUSTNESS)
printf(" robustness");
putchar('\n');
}
@@ -330,6 +351,24 @@ int main(int argc, char** argv)
get_client_api_name(api),
get_profile_name_glfw(profile));
}
if (glfwExtensionSupported("GL_ARB_robustness"))
{
int robustness;
GLint strategy;
glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy);
printf("%s robustness strategy (0x%08x): %s\n",
get_client_api_name(api),
strategy,
get_strategy_name_gl(strategy));
robustness = glfwGetWindowParam(window, GLFW_CONTEXT_ROBUSTNESS);
printf("%s robustness strategy parsed by GLFW: %s\n",
get_client_api_name(api),
get_strategy_name_glfw(robustness));
}
}
printf("%s context renderer string: \"%s\"\n",
@@ -339,9 +378,6 @@ int main(int argc, char** argv)
get_client_api_name(api),
glGetString(GL_VENDOR));
printf("OpenGL context debug flag saved by GLFW: %s\n",
glfwGetWindowParam(window, GLFW_OPENGL_DEBUG_CONTEXT) ? "true" : "false");
if (major > 1)
{
printf("%s context shading language version: \"%s\"\n",