mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Fixed output of GLFW-parsed context profile by glfwinfo.
This commit is contained in:
parent
467d501621
commit
bf43247aed
@ -74,7 +74,7 @@ static const char* get_client_api_name(int api)
|
||||
return "Unknown API";
|
||||
}
|
||||
|
||||
static const char* get_profile_name(GLint mask)
|
||||
static const char* get_profile_name_gl(GLint mask)
|
||||
{
|
||||
if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
|
||||
return "compatibility";
|
||||
@ -84,6 +84,16 @@ static const char* get_profile_name(GLint mask)
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static const char* get_profile_name_glfw(int profile)
|
||||
{
|
||||
if (profile == GLFW_OPENGL_COMPAT_PROFILE)
|
||||
return "compatibility";
|
||||
if (profile == GLFW_OPENGL_CORE_PROFILE)
|
||||
return "core";
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static void list_extensions(int api, int major, int minor)
|
||||
{
|
||||
int i;
|
||||
@ -302,13 +312,17 @@ int main(int argc, char** argv)
|
||||
|
||||
if (major > 3 || (major == 3 && minor >= 2))
|
||||
{
|
||||
int profile = glfwGetWindowParam(window, GLFW_OPENGL_PROFILE);
|
||||
|
||||
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask);
|
||||
printf("%s profile mask (0x%08x): %s\n",
|
||||
get_client_api_name(api),
|
||||
mask,
|
||||
get_profile_name(mask));
|
||||
get_profile_name_gl(mask));
|
||||
|
||||
printf("%s profile mask parsed by GLFW:\n", get_client_api_name(api));
|
||||
printf("%s profile mask parsed by GLFW: %s\n",
|
||||
get_client_api_name(api),
|
||||
get_profile_name_glfw(profile));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user