Minor fix for wxX11 compilation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-03-21 10:02:10 +00:00
parent 9a74fcaf97
commit e3baff1c85

View File

@@ -133,21 +133,13 @@ void wxGLContext::SetColour(const char *colour)
the_colour->Green(),
the_colour->Blue());
} else {
GLint pix = (GLint)the_colour->m_pixel;
if(pix == -1) {
XColor exact_def;
exact_def.red = (unsigned short)the_colour->Red() << 8;
exact_def.green = (unsigned short)the_colour->Green() << 8;
exact_def.blue = (unsigned short)the_colour->Blue() << 8;
exact_def.flags = DoRed | DoGreen | DoBlue;
if(!XAllocColor((Display*) m_window->GetXDisplay(),
(Colormap) wxTheApp->GetMainColormap(m_window->GetXDisplay()),
&exact_def)) {
wxDebugMsg("wxGLCanvas: cannot allocate color\n");
return;
}
pix = the_colour->m_pixel = exact_def.pixel;
}
the_colour->CalcPixel(wxTheApp->GetMainColormap(m_window->GetXDisplay()));
GLint pix = (GLint)the_colour->GetPixel();
if(pix == -1)
{
wxLogError("wxGLCanvas: cannot allocate color\n");
return;
}
glIndexi(pix);
}
}