#pragma hdrstop
#endif
+#include "wx/dcbuffer.h"
+
#ifndef WX_PRECOMP
#include "wx/module.h"
#endif
-#include "wx/dcbuffer.h"
-
// ============================================================================
// implementation
// ============================================================================
virtual bool OnInit() { return true; }
virtual void OnExit() { wxDELETE(ms_buffer); }
- static wxBitmap GetBuffer(int w, int h)
+ static wxBitmap* GetBuffer(int w, int h)
{
if ( !ms_buffer ||
w > ms_buffer->GetWidth() ||
delete ms_buffer;
ms_buffer = new wxBitmap(w, h);
}
-
- return *ms_buffer;
+ return ms_buffer;
}
private:
DECLARE_DYNAMIC_CLASS(wxSharedDCBufferManager)
};
+wxBitmap* wxSharedDCBufferManager::ms_buffer = NULL;
+
IMPLEMENT_DYNAMIC_CLASS(wxSharedDCBufferManager, wxModule)
// ============================================================================
void wxBufferedDC::UseBuffer(wxCoord w, wxCoord h)
{
- if ( !m_buffer.IsOk() )
+ if ( !m_buffer || !m_buffer->IsOk() )
{
if ( w == -1 || h == -1 )
m_dc->GetSize(&w, &h);
m_buffer = wxSharedDCBufferManager::GetBuffer(w, h);
}
- SelectObject(m_buffer);
+ SelectObject(*m_buffer);
}