|
|
@ -41,6 +41,9 @@ |
|
|
|
#define API_NAME_OPENGL "gl" |
|
|
|
#define API_NAME_OPENGL "gl" |
|
|
|
#define API_NAME_OPENGL_ES "es" |
|
|
|
#define API_NAME_OPENGL_ES "es" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define API_NAME_NATIVE "native" |
|
|
|
|
|
|
|
#define API_NAME_EGL "egl" |
|
|
|
|
|
|
|
|
|
|
|
#define PROFILE_NAME_CORE "core" |
|
|
|
#define PROFILE_NAME_CORE "core" |
|
|
|
#define PROFILE_NAME_COMPAT "compat" |
|
|
|
#define PROFILE_NAME_COMPAT "compat" |
|
|
|
|
|
|
|
|
|
|
@ -60,6 +63,9 @@ static void usage(void) |
|
|
|
printf(" -b, --behavior=BEHAVIOR the release behavior to use (" |
|
|
|
printf(" -b, --behavior=BEHAVIOR the release behavior to use (" |
|
|
|
BEHAVIOR_NAME_NONE " or " |
|
|
|
BEHAVIOR_NAME_NONE " or " |
|
|
|
BEHAVIOR_NAME_FLUSH ")\n"); |
|
|
|
BEHAVIOR_NAME_FLUSH ")\n"); |
|
|
|
|
|
|
|
printf(" -c, --context-api=API the context creation API to use (" |
|
|
|
|
|
|
|
API_NAME_NATIVE " or " |
|
|
|
|
|
|
|
API_NAME_EGL ")\n"); |
|
|
|
printf(" -d, --debug request a debug context\n"); |
|
|
|
printf(" -d, --debug request a debug context\n"); |
|
|
|
printf(" -f, --forward require a forward-compatible context\n"); |
|
|
|
printf(" -f, --forward require a forward-compatible context\n"); |
|
|
|
printf(" -h, --help show this help\n"); |
|
|
|
printf(" -h, --help show this help\n"); |
|
|
@ -165,15 +171,15 @@ static const char* get_strategy_name_glfw(int strategy) |
|
|
|
return "unknown"; |
|
|
|
return "unknown"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void list_context_extensions(int api, int major, int minor) |
|
|
|
static void list_context_extensions(int client, int major, int minor) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
GLint count; |
|
|
|
GLint count; |
|
|
|
const GLubyte* extensions; |
|
|
|
const GLubyte* extensions; |
|
|
|
|
|
|
|
|
|
|
|
printf("%s context extensions:\n", get_api_name(api)); |
|
|
|
printf("%s context extensions:\n", get_api_name(client)); |
|
|
|
|
|
|
|
|
|
|
|
if (api == GLFW_OPENGL_API && major > 2) |
|
|
|
if (client == GLFW_OPENGL_API && major > 2) |
|
|
|
{ |
|
|
|
{ |
|
|
|
glGetIntegerv(GL_NUM_EXTENSIONS, &count); |
|
|
|
glGetIntegerv(GL_NUM_EXTENSIONS, &count); |
|
|
|
|
|
|
|
|
|
|
@ -351,13 +357,13 @@ static void print_version(void) |
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv) |
|
|
|
int main(int argc, char** argv) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int ch, api, major, minor, revision, profile; |
|
|
|
int ch, client, context, major, minor, revision, profile; |
|
|
|
GLint redbits, greenbits, bluebits, alphabits, depthbits, stencilbits; |
|
|
|
GLint redbits, greenbits, bluebits, alphabits, depthbits, stencilbits; |
|
|
|
int list_extensions = GLFW_FALSE, list_layers = GLFW_FALSE; |
|
|
|
int list_extensions = GLFW_FALSE, list_layers = GLFW_FALSE; |
|
|
|
GLenum error; |
|
|
|
GLenum error; |
|
|
|
GLFWwindow* window; |
|
|
|
GLFWwindow* window; |
|
|
|
|
|
|
|
|
|
|
|
enum { API, BEHAVIOR, DEBUG, FORWARD, HELP, EXTENSIONS, LAYERS, |
|
|
|
enum { CLIENT, CONTEXT, BEHAVIOR, DEBUG, FORWARD, HELP, EXTENSIONS, LAYERS, |
|
|
|
MAJOR, MINOR, PROFILE, ROBUSTNESS, VERSION, |
|
|
|
MAJOR, MINOR, PROFILE, ROBUSTNESS, VERSION, |
|
|
|
REDBITS, GREENBITS, BLUEBITS, ALPHABITS, DEPTHBITS, STENCILBITS, |
|
|
|
REDBITS, GREENBITS, BLUEBITS, ALPHABITS, DEPTHBITS, STENCILBITS, |
|
|
|
ACCUMREDBITS, ACCUMGREENBITS, ACCUMBLUEBITS, ACCUMALPHABITS, |
|
|
|
ACCUMREDBITS, ACCUMGREENBITS, ACCUMBLUEBITS, ACCUMALPHABITS, |
|
|
@ -365,7 +371,8 @@ int main(int argc, char** argv) |
|
|
|
const struct option options[] = |
|
|
|
const struct option options[] = |
|
|
|
{ |
|
|
|
{ |
|
|
|
{ "behavior", 1, NULL, BEHAVIOR }, |
|
|
|
{ "behavior", 1, NULL, BEHAVIOR }, |
|
|
|
{ "client-api", 1, NULL, API }, |
|
|
|
{ "client-api", 1, NULL, CLIENT }, |
|
|
|
|
|
|
|
{ "context-api", 1, NULL, CONTEXT }, |
|
|
|
{ "debug", 0, NULL, DEBUG }, |
|
|
|
{ "debug", 0, NULL, DEBUG }, |
|
|
|
{ "forward", 0, NULL, FORWARD }, |
|
|
|
{ "forward", 0, NULL, FORWARD }, |
|
|
|
{ "help", 0, NULL, HELP }, |
|
|
|
{ "help", 0, NULL, HELP }, |
|
|
@ -410,7 +417,7 @@ int main(int argc, char** argv) |
|
|
|
switch (ch) |
|
|
|
switch (ch) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case 'a': |
|
|
|
case 'a': |
|
|
|
case API: |
|
|
|
case CLIENT: |
|
|
|
if (strcasecmp(optarg, API_NAME_OPENGL) == 0) |
|
|
|
if (strcasecmp(optarg, API_NAME_OPENGL) == 0) |
|
|
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); |
|
|
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); |
|
|
|
else if (strcasecmp(optarg, API_NAME_OPENGL_ES) == 0) |
|
|
|
else if (strcasecmp(optarg, API_NAME_OPENGL_ES) == 0) |
|
|
@ -439,6 +446,18 @@ int main(int argc, char** argv) |
|
|
|
exit(EXIT_FAILURE); |
|
|
|
exit(EXIT_FAILURE); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'c': |
|
|
|
|
|
|
|
case CONTEXT: |
|
|
|
|
|
|
|
if (strcasecmp(optarg, API_NAME_NATIVE) == 0) |
|
|
|
|
|
|
|
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API); |
|
|
|
|
|
|
|
else if (strcasecmp(optarg, API_NAME_EGL) == 0) |
|
|
|
|
|
|
|
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
usage(); |
|
|
|
|
|
|
|
exit(EXIT_FAILURE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
case 'd': |
|
|
|
case 'd': |
|
|
|
case DEBUG: |
|
|
|
case DEBUG: |
|
|
|
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE); |
|
|
|
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE); |
|
|
@ -616,30 +635,31 @@ int main(int argc, char** argv) |
|
|
|
|
|
|
|
|
|
|
|
// Report client API version
|
|
|
|
// Report client API version
|
|
|
|
|
|
|
|
|
|
|
|
api = glfwGetWindowAttrib(window, GLFW_CLIENT_API); |
|
|
|
client = glfwGetWindowAttrib(window, GLFW_CLIENT_API); |
|
|
|
|
|
|
|
context = glfwGetWindowAttrib(window, GLFW_CONTEXT_CREATION_API); |
|
|
|
major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); |
|
|
|
major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); |
|
|
|
minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); |
|
|
|
minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); |
|
|
|
revision = glfwGetWindowAttrib(window, GLFW_CONTEXT_REVISION); |
|
|
|
revision = glfwGetWindowAttrib(window, GLFW_CONTEXT_REVISION); |
|
|
|
profile = glfwGetWindowAttrib(window, GLFW_OPENGL_PROFILE); |
|
|
|
profile = glfwGetWindowAttrib(window, GLFW_OPENGL_PROFILE); |
|
|
|
|
|
|
|
|
|
|
|
printf("%s context version string: \"%s\"\n", |
|
|
|
printf("%s context version string: \"%s\"\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
glGetString(GL_VERSION)); |
|
|
|
glGetString(GL_VERSION)); |
|
|
|
|
|
|
|
|
|
|
|
printf("%s context version parsed by GLFW: %u.%u.%u\n", |
|
|
|
printf("%s context version parsed by GLFW: %u.%u.%u\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
major, minor, revision); |
|
|
|
major, minor, revision); |
|
|
|
|
|
|
|
|
|
|
|
// Report client API context properties
|
|
|
|
// Report client API context properties
|
|
|
|
|
|
|
|
|
|
|
|
if (api == GLFW_OPENGL_API) |
|
|
|
if (client == GLFW_OPENGL_API) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (major >= 3) |
|
|
|
if (major >= 3) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLint flags; |
|
|
|
GLint flags; |
|
|
|
|
|
|
|
|
|
|
|
glGetIntegerv(GL_CONTEXT_FLAGS, &flags); |
|
|
|
glGetIntegerv(GL_CONTEXT_FLAGS, &flags); |
|
|
|
printf("%s context flags (0x%08x):", get_api_name(api), flags); |
|
|
|
printf("%s context flags (0x%08x):", get_api_name(client), flags); |
|
|
|
|
|
|
|
|
|
|
|
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) |
|
|
|
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) |
|
|
|
printf(" forward-compatible"); |
|
|
|
printf(" forward-compatible"); |
|
|
@ -651,7 +671,7 @@ int main(int argc, char** argv) |
|
|
|
printf(" no-error"); |
|
|
|
printf(" no-error"); |
|
|
|
putchar('\n'); |
|
|
|
putchar('\n'); |
|
|
|
|
|
|
|
|
|
|
|
printf("%s context flags parsed by GLFW:", get_api_name(api)); |
|
|
|
printf("%s context flags parsed by GLFW:", get_api_name(client)); |
|
|
|
|
|
|
|
|
|
|
|
if (glfwGetWindowAttrib(window, GLFW_OPENGL_FORWARD_COMPAT)) |
|
|
|
if (glfwGetWindowAttrib(window, GLFW_OPENGL_FORWARD_COMPAT)) |
|
|
|
printf(" forward-compatible"); |
|
|
|
printf(" forward-compatible"); |
|
|
@ -670,12 +690,12 @@ int main(int argc, char** argv) |
|
|
|
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); |
|
|
|
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); |
|
|
|
|
|
|
|
|
|
|
|
printf("%s profile mask (0x%08x): %s\n", |
|
|
|
printf("%s profile mask (0x%08x): %s\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
mask, |
|
|
|
mask, |
|
|
|
get_profile_name_gl(mask)); |
|
|
|
get_profile_name_gl(mask)); |
|
|
|
|
|
|
|
|
|
|
|
printf("%s profile mask parsed by GLFW: %s\n", |
|
|
|
printf("%s profile mask parsed by GLFW: %s\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
get_profile_name_glfw(profile)); |
|
|
|
get_profile_name_glfw(profile)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -686,33 +706,33 @@ int main(int argc, char** argv) |
|
|
|
glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy); |
|
|
|
glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy); |
|
|
|
|
|
|
|
|
|
|
|
printf("%s robustness strategy (0x%08x): %s\n", |
|
|
|
printf("%s robustness strategy (0x%08x): %s\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
strategy, |
|
|
|
strategy, |
|
|
|
get_strategy_name_gl(strategy)); |
|
|
|
get_strategy_name_gl(strategy)); |
|
|
|
|
|
|
|
|
|
|
|
printf("%s robustness strategy parsed by GLFW: %s\n", |
|
|
|
printf("%s robustness strategy parsed by GLFW: %s\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
get_strategy_name_glfw(robustness)); |
|
|
|
get_strategy_name_glfw(robustness)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
printf("%s context renderer string: \"%s\"\n", |
|
|
|
printf("%s context renderer string: \"%s\"\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
glGetString(GL_RENDERER)); |
|
|
|
glGetString(GL_RENDERER)); |
|
|
|
printf("%s context vendor string: \"%s\"\n", |
|
|
|
printf("%s context vendor string: \"%s\"\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
glGetString(GL_VENDOR)); |
|
|
|
glGetString(GL_VENDOR)); |
|
|
|
|
|
|
|
|
|
|
|
if (major >= 2) |
|
|
|
if (major >= 2) |
|
|
|
{ |
|
|
|
{ |
|
|
|
printf("%s context shading language version: \"%s\"\n", |
|
|
|
printf("%s context shading language version: \"%s\"\n", |
|
|
|
get_api_name(api), |
|
|
|
get_api_name(client), |
|
|
|
glGetString(GL_SHADING_LANGUAGE_VERSION)); |
|
|
|
glGetString(GL_SHADING_LANGUAGE_VERSION)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
printf("%s framebuffer:\n", get_api_name(api)); |
|
|
|
printf("%s framebuffer:\n", get_api_name(client)); |
|
|
|
|
|
|
|
|
|
|
|
if (api == GLFW_OPENGL_API && profile == GLFW_OPENGL_CORE_PROFILE) |
|
|
|
if (client == GLFW_OPENGL_API && profile == GLFW_OPENGL_CORE_PROFILE) |
|
|
|
{ |
|
|
|
{ |
|
|
|
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, |
|
|
|
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, |
|
|
|
GL_BACK_LEFT, |
|
|
|
GL_BACK_LEFT, |
|
|
@ -752,7 +772,7 @@ int main(int argc, char** argv) |
|
|
|
printf(" red: %u green: %u blue: %u alpha: %u depth: %u stencil: %u\n", |
|
|
|
printf(" red: %u green: %u blue: %u alpha: %u depth: %u stencil: %u\n", |
|
|
|
redbits, greenbits, bluebits, alphabits, depthbits, stencilbits); |
|
|
|
redbits, greenbits, bluebits, alphabits, depthbits, stencilbits); |
|
|
|
|
|
|
|
|
|
|
|
if (api == GLFW_OPENGL_ES_API || |
|
|
|
if (client == GLFW_OPENGL_ES_API || |
|
|
|
glfwExtensionSupported("GL_ARB_multisample") || |
|
|
|
glfwExtensionSupported("GL_ARB_multisample") || |
|
|
|
major > 1 || minor >= 3) |
|
|
|
major > 1 || minor >= 3) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -763,7 +783,7 @@ int main(int argc, char** argv) |
|
|
|
printf(" samples: %u sample buffers: %u\n", samples, samplebuffers); |
|
|
|
printf(" samples: %u sample buffers: %u\n", samples, samplebuffers); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (api == GLFW_OPENGL_API && profile != GLFW_OPENGL_CORE_PROFILE) |
|
|
|
if (client == GLFW_OPENGL_API && profile != GLFW_OPENGL_CORE_PROFILE) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLint accumredbits, accumgreenbits, accumbluebits, accumalphabits; |
|
|
|
GLint accumredbits, accumgreenbits, accumbluebits, accumalphabits; |
|
|
|
GLint auxbuffers; |
|
|
|
GLint auxbuffers; |
|
|
@ -779,7 +799,7 @@ int main(int argc, char** argv) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (list_extensions) |
|
|
|
if (list_extensions) |
|
|
|
list_context_extensions(api, major, minor); |
|
|
|
list_context_extensions(client, major, minor); |
|
|
|
|
|
|
|
|
|
|
|
printf("Vulkan loader: %s\n", |
|
|
|
printf("Vulkan loader: %s\n", |
|
|
|
glfwVulkanSupported() ? "available" : "missing"); |
|
|
|
glfwVulkanSupported() ? "available" : "missing"); |
|
|
|