/////////////////////////////////////////////////////////////////////////////
// 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
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
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);
+ }
}