mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
Added initial ARB_robustness support.
This commit is contained in:
+18
-3
@@ -44,8 +44,9 @@
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
printf("Usage: version [-h] [-m MAJOR] [-n MINOR] [-d] [-l] [-f] [-p PROFILE]\n");
|
||||
printf("Usage: version [-h] [-m MAJOR] [-n MINOR] [-d] [-l] [-f] [-p PROFILE] [-r STRATEGY]\n");
|
||||
printf("available profiles: core compat es2\n");
|
||||
printf("available strategies: none lose\n");
|
||||
}
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
@@ -113,12 +114,12 @@ static void list_extensions(int major, int minor)
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int ch, profile = 0, major = 1, minor = 0, revision;
|
||||
int ch, profile = 0, strategy = 0, major = 1, minor = 0, revision;
|
||||
GLboolean debug = GL_FALSE, forward = GL_FALSE, list = GL_FALSE;
|
||||
GLint flags, mask;
|
||||
GLFWwindow window;
|
||||
|
||||
while ((ch = getopt(argc, argv, "dfhlm:n:p:")) != -1)
|
||||
while ((ch = getopt(argc, argv, "dfhlm:n:p:r:")) != -1)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
@@ -153,6 +154,17 @@ int main(int argc, char** argv)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if (strcasecmp(optarg, "none") == 0)
|
||||
strategy = GLFW_OPENGL_NO_RESET_NOTIFICATION;
|
||||
else if (strcasecmp(optarg, "lose") == 0)
|
||||
strategy = GLFW_OPENGL_LOSE_CONTEXT_ON_RESET;
|
||||
else
|
||||
{
|
||||
usage();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -185,6 +197,9 @@ int main(int argc, char** argv)
|
||||
if (profile != 0)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, profile);
|
||||
|
||||
if (strategy)
|
||||
glfwOpenWindowHint(GLFW_OPENGL_ROBUSTNESS, strategy);
|
||||
|
||||
// We assume here that we stand a better chance of success by leaving all
|
||||
// possible details of pixel format selection to GLFW
|
||||
|
||||
|
||||
Reference in New Issue
Block a user