Re #320 Adopt the Windows compatible detection method under Linux (it also works), for simpler code

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3540 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 34affa3f49f01783c9bf5a90a615155bf8530f03
Former-commit-id: 343db91a01caf5b1040060a74e756d50a2c1623a
This commit is contained in:
pouillot 2011-05-03 13:42:56 +00:00
parent f6be8dc99b
commit aa9a40f03a

View file

@ -203,22 +203,16 @@ bool GfglFeatures::detectBestSupport(int& nWidth, int& nHeight, int& nDepth,
// Anti-aliasing : detect the max supported number of samples
// (assumed to be <= 32).
#ifndef WIN32
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
#endif
int nMaxMultiSamples = 32; // Hard coded max value for the moment.
while (!pWinSurface && nMaxMultiSamples > 1)
{
// Set the anti-aliasing attributes and setup the video mode.
#ifdef WIN32
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
#endif
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, nMaxMultiSamples);
pWinSurface = SDL_SetVideoMode(nWidth, nHeight, nCurrDepth, bfVideoMode);
// Now check if we have a video mode, and if it actually features
// what we specified.
#ifdef WIN32
int nActualSampleBuffers = 0;
SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &nActualSampleBuffers);
int nActualMultiSamples = 0;
@ -229,7 +223,6 @@ bool GfglFeatures::detectBestSupport(int& nWidth, int& nHeight, int& nDepth,
// If not, try a lower number of samples.
if (nActualSampleBuffers == 0 || nActualMultiSamples != nMaxMultiSamples)
pWinSurface = 0;
#endif
if (!pWinSurface)
{
GfLogTrace("%d+%d bit %dx anti-aliased double-buffer not supported\n",