X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2341cf5f5955a55d80aebca877a14098803af6a3..a24dc1a836159cbec24c577d9e576f8dbafad728:/src/msw/glcanvas.cpp diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index feb72526b1..c5a0523d00 100644 --- a/src/msw/glcanvas.cpp +++ b/src/msw/glcanvas.cpp @@ -134,17 +134,14 @@ void wxGLContext::SetCurrent() void wxGLContext::SetColour(const wxChar *colour) { - float r = 0.0; - float g = 0.0; - float b = 0.0; - wxColour *col = wxTheColourDatabase->FindColour(colour); - if (col) - { - r = (float)(col->Red()/256.0); - g = (float)(col->Green()/256.0); - b = (float)(col->Blue()/256.0); - glColor3f( r, g, b); - } + wxColour col = wxTheColourDatabase->Find(colour); + if (col.Ok()) + { + float r = (float)(col.Red()/256.0); + float g = (float)(col.Green()/256.0); + float b = (float)(col.Blue()/256.0); + glColor3f( r, g, b); + } }