SetTo

Note: If the active surface is a Bitmap, calling this function will refresh the active surface!

static void SetTo(
const Bitmap &buffer )

Sets the Bitmap as the active rendering surface.

static void SetTo(
OlRenderTarget buffer )

Sets specified OpenGL buffer image as the active rendering surface.

The only possible choise for now is SCREEN_BACKBUF (the screen backbuffer).

As you might guess, the screen backbuffer is the default rendering surface.

Warning: You shouldn't render anything to the backbuffer during the frame before selecting a Bitmap as the active surface! Otherwise the program might not work correctly with older hardware.

Also rendering a Bitmap to itself may cause undefined results. Most likely you'll get some gray pixels here and there, but it won't look like what you might expect, anyways.

Examples

Bitmap myBmp( ... );

// Sets myBmp as the active canvas //
Canvas::SetTo( myBmp );

// Set the screen as the active canvas //
Canvas::SetTo( SCREEN_BACKBUF );


Other functions of the class Canvas
SetTo
Selects the active rendering surface
Refresh
Refresh the contents of the active rendering surface
Fill
Fills the active rendering surface with the specified color
SetClipping
Sets the clipping region of the active rendering surface
DisableClipping
Disables the clipping region
GetClippingRegion
GetClippingRegion
Width
Returns the width of the active rendering surface
Height
Returns the height of the active rendering surface
Save
Saves the contents of the surface to an image file

Advanced functions

SetPixelWriteMode
Selects which color components the rendering functions affect
GetMemoryBitmap
Returns the contents of the Canvas in a memory bitmap
Push
Pushes the active Canvas to a stack
Pop
Pops the most recently stored Canvas from the stack


Questions about SetTo? Click here.