+class wxSharedDCBufferManager : public wxModule
+{
+public:
+ wxSharedDCBufferManager() { }
+
+ virtual bool OnInit() { return true; }
+ virtual void OnExit() { wxDELETE(ms_buffer); }
+
+ static wxBitmap* GetBuffer(int w, int h)
+ {
+ if ( !ms_buffer ||
+ w > ms_buffer->GetWidth() ||
+ h > ms_buffer->GetHeight() )
+ {
+ delete ms_buffer;
+ ms_buffer = new wxBitmap(w, h);
+ }
+ return ms_buffer;
+ }
+
+private:
+ static wxBitmap *ms_buffer;
+
+ DECLARE_DYNAMIC_CLASS(wxSharedDCBufferManager)
+};
+
+wxBitmap* wxSharedDCBufferManager::ms_buffer = NULL;
+
+IMPLEMENT_DYNAMIC_CLASS(wxSharedDCBufferManager, wxModule)