Implemented bug #5

Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401672
This commit is contained in:
Sam Lantinga 2006-04-27 08:39:51 +00:00
parent b32d3f9c24
commit 37adc6aae8
9 changed files with 125 additions and 10 deletions

View file

@ -445,7 +445,7 @@ void DrawLogoBlit(void)
}
int RunGLTest( int argc, char* argv[],
int logo, int logocursor, int slowly, int bpp, float gamma, int noframe, int fsaa, int sync )
int logo, int logocursor, int slowly, int bpp, float gamma, int noframe, int fsaa, int sync, int accel )
{
int i;
int rgb_size[3];
@ -531,6 +531,9 @@ int 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 );
}
if ( sync ) {
SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 1 );
} else {
@ -566,6 +569,10 @@ int RunGLTest( int argc, char* argv[],
SDL_GL_GetAttribute( SDL_GL_MULTISAMPLESAMPLES, &value );
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 );
}
if ( sync ) {
SDL_GL_GetAttribute( SDL_GL_SWAP_CONTROL, &value );
printf( "SDL_GL_SWAP_CONTROL: requested 1, got %d\n", value );
@ -779,6 +786,7 @@ int main(int argc, char *argv[])
float gamma = 0.0;
int noframe = 0;
int fsaa = 0;
int accel = 0;
int sync = 0;
logo = 0;
@ -814,6 +822,9 @@ int main(int argc, char *argv[])
if ( strcmp(argv[i], "-fsaa") == 0 ) {
++fsaa;
}
if ( strcmp(argv[i], "-accel") == 0 ) {
++accel;
}
if ( strcmp(argv[i], "-sync") == 0 ) {
++sync;
}
@ -825,7 +836,7 @@ int main(int argc, char *argv[])
}
}
for ( i=0; i<numtests; ++i ) {
RunGLTest(argc, argv, logo, logocursor, slowly, bpp, gamma, noframe, fsaa, sync);
RunGLTest(argc, argv, logo, logocursor, slowly, bpp, gamma, noframe, fsaa, sync, accel);
}
return 0;
}