From 15b239c0eb73e1b9b0dad29ced9c7435122b33d4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 15 Apr 2007 23:29:45 +0000 Subject: [PATCH] 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 --- include/wx/glcanvas.h | 7 +------ src/common/glcmn.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/wx/glcanvas.h b/include/wx/glcanvas.h index adbbb033a1..2a40221169 100644 --- a/include/wx/glcanvas.h +++ b/include/wx/glcanvas.h @@ -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(); diff --git a/src/common/glcmn.cpp b/src/common/glcmn.cpp index ffcb45a603..faa42827c1 100644 --- a/src/common/glcmn.cpp +++ b/src/common/glcmn.cpp @@ -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 -- 2.47.2