|virtual bool||OnPaint (Graphics2D &graphics, const std::vector< Rect > &paint_rects, const Rect &paint_bounds)=0|
Constructor and Destructor Details
|virtual bool pp::PaintManager::Client::OnPaint||(||Graphics2D &||graphics,|
|const std::vector< Rect > &||paint_rects,|
|const Rect &||paint_bounds|
OnPaint() paints the given invalid area of the instance to the given graphics device.
Returns true if anything was painted.
You are given the list of rects to paint in
paint_rects, and the union of all of these rects in
paint_bounds. You only have to paint the area inside each of the
paint_rects, but can paint more if you want (some apps may just want to paint the union).
Do not call Flush() on the graphics device, this will be done automatically if you return true from this function since the
PaintManager needs to handle the callback.
It is legal for you to cause invalidates inside of Paint which will then get executed as soon as the Flush for this update has completed. However, this is not very nice to the host system since it will spin the CPU, possibly updating much faster than necessary. It is best to have a 1/60 second timer to do an invalidate instead. This will limit your animation to the slower of 60Hz or "however fast Flush can complete."
[in] graphics A
Graphics2Dto be painted.
[in] paint_rects A list of rects to paint. [in] paint_bounds A union of the rects to paint.
- true if successful, otherwise false.
The documentation for this class was generated from the following file: