MvcBufferedWrapper_T Class

class MvcBufferedWrapper_T

The MvcBufferedWrapper_T class wraps a viewport and provides off-screen, flicker free rendering.

Defined in: MvcBufferedWrapper.h

Class Template Arguments

base_t

The class of the viewport to derive from.

Class Members

MvcBufferedWrapper_T()

Constructor.

virtual  ~MvcBufferedWrapper_T()

Destructor.

BOOL  m_bEnableBuffering

Turn screen buffering on or off

CDC*  m_pBufferDC

Memory DC for offscreen buffer

CBitmap*  m_pBufferBmp

Bitmap that is selected into offscreen DC

CPalette*  m_pBufferPal

Palette used for offscreen buffer

HBITMAP  m_hPrevBufferBmp

For restoring buffer DC

HPALETTE  m_hPrevBufferPal

For restoring buffer DC

int  m_nBufPadding

Extra width and height added to buffer to reduce reallocation.

CRect  m_rcUpdate

Update rectangle.

void  EnableBuffering(const BOOL bEnableBuffering)

Enable or disable use of the offscreen buffer.

virtual void  DrawOffscreen()

Draws an area of the viewport to the offscreen buffer.

virtual void  Refresh(CDC* pDC)

Transfers the entire offscreen buffer to a screen DC.

virtual void  Refresh(CDC* pDC, const CRect &amprcUpdate)

Transfers a rectangular area of the offscreen buffer to a screen DC.

void  SetPalette(CPalette *pPal)

Set the palette to use for drawing to the offscreen buffer.

void  SetBufferPadding(const int nBufPadding)

Set padding added to offscreen buffer to reduce reallocation when

virtual void  Draw(CDC* pDC)

Draws the entire viewport to a device context.

virtual void  OnInitialUpdate()

Initializes the viewport.

virtual void  InvalidateRect(const CRect& rcLog, BOOL bErase = TRUE, BOOL bRepairNow = FALSE)

Invalidate the specified rectangle within the viewport.

virtual BOOL  GetUpdateRect(LPRECT lpRect, BOOL bErase = FALSE)

Returns the current invalid region as a rectangle.

virtual CSize  SetSize(int cx, int cy)

Set the width and height of the viewport in device units. Reallocates

BOOL  CreateOffscreenBuffer()

Creates memory DC and bitmap for offscreen buffer.

BOOL  NeedToResizeBuffer()

Compares the current buffer size to the viewport dimensions.

void  DestroyOffscreenBuffer()

Deletes the bitmap and memory DC.

virtual void  OnBufferedEraseBkgnd(CDC* pDC, CRect rcFill)

Clears the offscreen buffer before rendering.