Fix creating wxGLCanvas without any attributes in wxMSW.

This was broken by the changes of r77018, see #16402.

Just check that we do have the attributes before examining them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-08-15 12:14:06 +00:00
parent a728a9ac15
commit 74421a7f35

View File

@@ -321,25 +321,28 @@ bool wxGLCanvas::Create(wxWindow *parent,
glVersionMinor = 0; glVersionMinor = 0;
// Check for a core profile request // 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: switch ( attribList[i++] )
useGLCoreProfile = true; {
break; case WX_GL_CORE_PROFILE:
useGLCoreProfile = true;
break;
case WX_GL_MAJOR_VERSION: case WX_GL_MAJOR_VERSION:
glVersionMajor = attribList[i++]; glVersionMajor = attribList[i++];
break; break;
case WX_GL_MINOR_VERSION: case WX_GL_MINOR_VERSION:
glVersionMinor = attribList[i++]; glVersionMinor = attribList[i++];
break; break;
default: default:
// ignore all other flags for now // ignore all other flags for now
break; break;
}
} }
} }