don't erase background in GL canvases to reduce flicker

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-04-15 23:29:45 +00:00
parent dc2819335f
commit 15b239c0eb
2 changed files with 12 additions and 6 deletions

View File

@ -77,12 +77,7 @@ class WXDLLIMPEXP_GL wxGLCanvasBase : public wxWindow
{
public:
// default ctor doesn't initialize the window, use Create() later
wxGLCanvasBase()
{
#if WXWIN_COMPATIBILITY_2_8
m_glContext = NULL;
#endif
}
wxGLCanvasBase();
virtual ~wxGLCanvasBase();

View File

@ -41,6 +41,17 @@ IMPLEMENT_CLASS(wxGLApp, wxApp)
// implementation
// ============================================================================
wxGLCanvasBase::wxGLCanvasBase()
{
#if WXWIN_COMPATIBILITY_2_8
m_glContext = NULL;
#endif
// we always paint background entirely ourselves so prevent wx from erasing
// it to avoid flicker
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
}
void wxGLCanvasBase::SetCurrent(const wxGLContext& context) const
{
// although on MSW it works even if the window is still hidden, it doesn't