This is a subclass of wxBufferedDC which can be used inside of an OnPaint() event handler. Just create an object of this class instead of wxPaintDC and that's all you have to do to (mostly) avoid flicker. The only thing to watch out for is that if you are using this class together with wxScrolledWindow, you probably do not want to call PrepareDC on it as it already does this internally for the real underlying wxPaintDC.
wxBufferedPaintDC(wxWindow *window, const wxBitmap& buffer = wxNullBitmap)
As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).
Copies everything drawn on the DC so far to the window associated with this object, using a wxPaintDC.