/////////////////////////////////////////////////////////////////////////////
// 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
m_hDC = win->GetHDC();
m_glContext = wglCreateContext((HDC) m_hDC);
- wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
+ wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGL context") );
wglMakeCurrent((HDC) m_hDC, m_glContext);
}
m_hDC = win->GetHDC();
m_glContext = wglCreateContext((HDC) m_hDC);
- wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
+ wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGL context") );
if( other != 0 )
wglShareLists( other->m_glContext, m_glContext );
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);
+ }
}
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
- SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
- SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
- SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());