mirror of
https://github.com/yawut/SDL.git
synced 2026-08-24 09:45:09 -05:00
Implemented bug #5
Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user