Add some more specification to the attribList used for setting up our wxGLCanvas. It turns out that wxMSW will set PIXELFORMATDESCRIPTOR.cColorBits to 0 if there isn't anything in the attribList to specify a desired number of bits, which may be what some OpenGL drivers break on. (Shotgun debugging at its finest.)

Originally committed to SVN as r5739.
This commit is contained in:
Niels Martin Hansen 2011-10-16 22:34:59 +00:00
parent 92368a7aa6
commit 04249816fb
1 changed files with 10 additions and 1 deletions

View File

@ -109,7 +109,16 @@ END_EVENT_TABLE()
//////////////
// Parameters
int attribList[] = { WX_GL_RGBA , WX_GL_DOUBLEBUFFER, WX_GL_STENCIL_SIZE, 8, 0 };
int attribList[] = {
WX_GL_RGBA,
WX_GL_DOUBLEBUFFER,
WX_GL_STENCIL_SIZE, 8, // stencil buffer is needed for the shape overlay drawing stuff
WX_GL_MIN_RED, 8, // wx implementation thing:
WX_GL_MIN_GREEN, 8, // wxMSW sets pfd.cColorBits to 0 if given an attribList
WX_GL_MIN_BLUE, 8, // where none of WX_GL_MIN_(RED|GREEN|BLUE) or WX_GL_BUFFER_SIZE are set.
WX_GL_BUFFER_SIZE, 24, // WX_GL_BUFFER_SIZE must be set last or it will get a nonsense value.
0
};
///////////////
// Constructor