OpenGL hardware acceleration defaults on

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404319
This commit is contained in:
Sam Lantinga 2009-12-15 20:36:31 +00:00
parent abec9e44fa
commit fe2b42f86c
6 changed files with 37 additions and 41 deletions

View file

@ -370,7 +370,7 @@ DrawLogoTexture(void)
int
RunGLTest(int argc, char *argv[],
int logo, int logocursor, int slowly, int bpp, float gamma,
int noframe, int fsaa, int sync, int accel)
int noframe, int fsaa, int sync, int noaccel)
{
int i;
int rgb_size[3];
@ -454,9 +454,7 @@ RunGLTest(int argc, char *argv[],
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa);
}
if (accel) {
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
}
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, !noaccel);
if (SDL_SetVideoMode(w, h, bpp, video_flags) == NULL) {
fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
SDL_Quit();
@ -493,10 +491,8 @@ RunGLTest(int argc, char *argv[],
printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa,
value);
}
if (accel) {
SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
}
SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
printf("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d\n", !noaccel, value);
if (sync) {
printf("Buffer swap interval: requested 1, got %d\n",
SDL_GL_GetSwapInterval());
@ -707,7 +703,7 @@ main(int argc, char *argv[])
float gamma = 0.0;
int noframe = 0;
int fsaa = 0;
int accel = 0;
int noaccel = 0;
int sync = 0;
logo = 0;
@ -738,22 +734,22 @@ main(int argc, char *argv[])
if (strcmp(argv[i], "-fsaa") == 0) {
++fsaa;
}
if (strcmp(argv[i], "-accel") == 0) {
++accel;
if (strcmp(argv[i], "-noaccel") == 0) {
++noaccel;
}
if (strcmp(argv[i], "-sync") == 0) {
++sync;
}
if (strncmp(argv[i], "-h", 2) == 0) {
printf
("Usage: %s [-twice] [-logo] [-logocursor] [-slow] [-bpp n] [-gamma n] [-noframe] [-fsaa] [-accel] [-sync] [-fullscreen]\n",
("Usage: %s [-twice] [-logo] [-logocursor] [-slow] [-bpp n] [-gamma n] [-noframe] [-fsaa] [-noaccel] [-sync] [-fullscreen]\n",
argv[0]);
exit(0);
}
}
for (i = 0; i < numtests; ++i) {
RunGLTest(argc, argv, logo, logocursor, slowly, bpp, gamma,
noframe, fsaa, sync, accel);
noframe, fsaa, sync, noaccel);
}
return 0;
}