fix an OpenGL performance issue running on some Linux machines

(apparently searching for a framebuffer with more samples makes NVIDIA Quadro slow)
This commit is contained in:
Erwin Coumans
2015-06-03 17:18:56 -07:00
parent 190382e9ec
commit 85acb2a009

View File

@@ -567,7 +567,8 @@ if (res==0)
printf( "Failed to retrieve a framebuffer config\n" ); printf( "Failed to retrieve a framebuffer config\n" );
exit(1); exit(1);
} }
///don't use highest samples, it is really slow on some NVIDIA Quadro cards
#ifdef USE_HIGHEST_SAMPLES
int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999; int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999;
int i; int i;
@@ -593,6 +594,9 @@ if (res==0)
} }
m_data->m_bestFbc = fbc[ best_fbc ]; m_data->m_bestFbc = fbc[ best_fbc ];
#else
m_data->m_bestFbc = *fbc;
#endif
// Be sure to free the FBConfig list allocated by glXChooseFBConfig() // Be sure to free the FBConfig list allocated by glXChooseFBConfig()
MyXFree( fbc ); MyXFree( fbc );