Fix creating wxGLCanvas without any attributes in wxMSW
This was broken by the changes off0e67ed517
, see #16402. Just check that we do have the attributes before examining them. (cherry picked from commit74421a7f35
)
This commit is contained in:
committed by
Dimitri Schoolwerth
parent
12d9c4ea9d
commit
8675f35fc8
@@ -321,25 +321,28 @@ bool wxGLCanvas::Create(wxWindow *parent,
|
||||
glVersionMinor = 0;
|
||||
|
||||
// Check for a core profile request
|
||||
for ( int i = 0; attribList[i]; )
|
||||
if ( attribList )
|
||||
{
|
||||
switch ( attribList[i++] )
|
||||
for ( int i = 0; attribList[i]; )
|
||||
{
|
||||
case WX_GL_CORE_PROFILE:
|
||||
useGLCoreProfile = true;
|
||||
break;
|
||||
switch ( attribList[i++] )
|
||||
{
|
||||
case WX_GL_CORE_PROFILE:
|
||||
useGLCoreProfile = true;
|
||||
break;
|
||||
|
||||
case WX_GL_MAJOR_VERSION:
|
||||
glVersionMajor = attribList[i++];
|
||||
break;
|
||||
case WX_GL_MAJOR_VERSION:
|
||||
glVersionMajor = attribList[i++];
|
||||
break;
|
||||
|
||||
case WX_GL_MINOR_VERSION:
|
||||
glVersionMinor = attribList[i++];
|
||||
break;
|
||||
case WX_GL_MINOR_VERSION:
|
||||
glVersionMinor = attribList[i++];
|
||||
break;
|
||||
|
||||
default:
|
||||
// ignore all other flags for now
|
||||
break;
|
||||
default:
|
||||
// ignore all other flags for now
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user