31#include <wx/glcanvas.h>
39 wxASSERT( aAntiAliasingMode <= ANTIALIASING_MODE::AA_8X );
41 auto makeAttribs = [aAlpha](
int aSamplers )
43 wxGLAttributes dispAttrs;
49 .Samplers( aSamplers )
50 .SampleBuffers( aSamplers >= 0 ? 1 : -1 )
51 .MinRGBA( 8, 8, 8, aAlpha ? 8 : -1 )
59 if( aAntiAliasingMode > ANTIALIASING_MODE::AA_NONE )
62 if( wxGLCanvas::IsDisplaySupported( makeAttribs( 0 ) ) )
64 static const int aaSamples[4] = { 0, 2, 4, 8 };
67 maxSamples = aaSamples[
static_cast<int>( aAntiAliasingMode )];
69 while( maxSamples > 0 && !wxGLCanvas::IsDisplaySupported( makeAttribs( maxSamples ) ) )
71 maxSamples = maxSamples >> 1;
76 return makeAttribs( maxSamples );
static const wxGLAttributes GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode, bool aAlpha=false)
Get a list of attributes to pass to wxGLCanvas.
Declaration of the cogl_att_list class.
ANTIALIASING_MODE
Anti-aliasing options.