X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2341cf5f5955a55d80aebca877a14098803af6a3..665b71b17c8eb8f2586a8c84f8d9cf0d8559bf35:/src/msw/glcanvas.cpp diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index feb72526b1..75f1b955ff 100644 --- a/src/msw/glcanvas.cpp +++ b/src/msw/glcanvas.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: src/msw/glcanvas.cpp -// Purpose: wxGLCanvas, for using OpenGL with wxWindows under MS Windows +// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under MS Windows // Author: Julian Smart // Modified by: // Created: 04/01/98 @@ -46,7 +46,7 @@ WX_CHECK_BUILD_OPTIONS("wxGL") these two libraries to either the Makefile or project file. This is NOT a recommended technique, and certainly is unlikely to be used - anywhere else in wxWindows given it is so specific to not only wxMSW, but + anywhere else in wxWidgets given it is so specific to not only wxMSW, but also the VC compiler. However, in the case of opengl support, it's an applicable technique as opengl is optional in setup.h This code (wrapped by wxUSE_GLCANVAS), now allows opengl support to be added purely by modifying @@ -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); + } }