]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/dcbuffer.h
ebb7bd1751d7d8b6253303a01b9386e1fd2e7d14
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxBufferedDC class
4 // Author: Ron Lee <ron@debian.org>
8 // Copyright: (c) Ron Lee
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DCBUFFER_H_
13 #define _WX_DCBUFFER_H_
16 #pragma interface "dcbuffer.h"
19 #include "wx/dcmemory.h"
22 // ==============================================================
23 // Double buffering helper.
24 // --------------------------------------------------------------
26 class wxBufferedDC
: public wxMemoryDC
30 // Without the existence of a wxNullDC, this must be
31 // a pointer, else it could probably be a reference.
38 // Default ctor, must subsequently call Init for
39 // two stage construction.
45 // Construct a wxBufferedDC using a user supplied buffer.
47 wxBufferedDC( wxDC
*dc
, const wxBitmap
&buffer
);
49 // Construct a wxBufferedDC with an internal buffer of 'area'
50 // (where area is usually something like the size of the window
53 wxBufferedDC( wxDC
*dc
, const wxSize
&area
);
55 // default copy ctor ok.
57 // The usually desired action in the dtor is to blit the buffer.
61 // These reimplement the actions of the ctors for
62 // two stage creation, but are not used by the ctors
63 // themselves to save a few cpu cycles.
65 void Init( wxDC
*dc
, const wxBitmap
&bitmap
);
66 void Init( wxDC
*dc
, const wxSize
&area
);
68 // Blits the buffer to the dc, and detaches the dc from
69 // the buffer. Usually called in the dtor or by the dtor
70 // of derived classes if the BufferedDC must blit before
71 // the derived class (which may own the dc it's blitting
78 // ==============================================================
79 // Double buffered PaintDC.
80 // --------------------------------------------------------------
82 // Creates a double buffered wxPaintDC, optionally allowing the
83 // user to specify their own buffer to use.
85 class wxBufferedPaintDC
: public wxBufferedDC
93 wxBufferedPaintDC( wxWindow
*window
, const wxBitmap
&buffer
= wxNullBitmap
);
95 // default copy ctor ok.
101 #endif // _WX_DCBUFFER_H_