]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/glcanvas.cpp
Added ability to execute more code after the widget is created
[wxWidgets.git] / src / msw / glcanvas.cpp
index feb72526b16d5892de25aae031b2e060bff746ad..c5a0523d00ca861c6960996ee35ecb72fcff9747 100644 (file)
@@ -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);
+    }
 }