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:
@@ -133,21 +133,13 @@ void wxGLContext::SetColour(const char *colour)
|
|||||||
the_colour->Green(),
|
the_colour->Green(),
|
||||||
the_colour->Blue());
|
the_colour->Blue());
|
||||||
} else {
|
} else {
|
||||||
GLint pix = (GLint)the_colour->m_pixel;
|
the_colour->CalcPixel(wxTheApp->GetMainColormap(m_window->GetXDisplay()));
|
||||||
if(pix == -1) {
|
GLint pix = (GLint)the_colour->GetPixel();
|
||||||
XColor exact_def;
|
if(pix == -1)
|
||||||
exact_def.red = (unsigned short)the_colour->Red() << 8;
|
{
|
||||||
exact_def.green = (unsigned short)the_colour->Green() << 8;
|
wxLogError("wxGLCanvas: cannot allocate color\n");
|
||||||
exact_def.blue = (unsigned short)the_colour->Blue() << 8;
|
return;
|
||||||
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;
|
|
||||||
}
|
|
||||||
glIndexi(pix);
|
glIndexi(pix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user