]> git.saurik.com Git - wxWidgets.git/commitdiff
don't erase background in GL canvases to reduce flicker
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 15 Apr 2007 23:29:45 +0000 (23:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 15 Apr 2007 23:29:45 +0000 (23:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/glcanvas.h
src/common/glcmn.cpp

index adbbb033a1341891ddbd8105b8461e0d79eb2b95..2a40221169142e0c36364ee3b840621cdec894ac 100644 (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();
 
index ffcb45a60366083877286f4be102f24b2cf00949..faa42827c15ab32fad333a3aabcb8c4de9eee148 100644 (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