Other surface (any class derived from Surface) may be attached to VirtualSurface, in a father-child relationship. Rendering is done automatically, using this VirtualSurface as an intermediate SDL_Surface, in a efficient way. More...
#include <VirtualSurface.hh>
Inheritance diagram for VirtualSurface:

Public Member Functions | |
| VirtualSurface (const std::string &name, SDL_Surface *surf) | |
| VirtualSurface (const std::string &name, int width, int height) | |
| void | addChild (Surface *child) |
| Add a child to this VirtualSurface. | |
| void | removeChild (Surface *child) |
| Remove a child to this VirtualSurface. | |
| int | getNbChild () const |
| Get the number of child currently contained by this VirtualSurface. | |
| void | updateChildZOrder () |
| Private method, you shouldn't need that. | |
| virtual void | enable () |
| Enable this widget. | |
| virtual void | show () |
| Show this surface on the screen. | |
| virtual void | setZoom (double zoom) |
| virtual void | update () |
| Method called each frame, to perfom user custom code. | |
| virtual void | render () |
| Private method. | |
| void | invalidate (const Rect &zone) |
| Set a marker on a rectangle that must be redrawn next time. | |
| void | invalidate (const Point &pos, const Point &size) |
| Set a marker on a rectangle that must be redrawn next time. | |
Protected Types | |
| typedef std::vector< Surface * > | SurfaceList |
| typedef std::vector< Rect > | RectList |
Protected Attributes | |
| SurfaceList | child_list_ |
| RectList | invalidated_surf_ |
| std::string | name_ |
Other surface (any class derived from Surface) may be attached to VirtualSurface, in a father-child relationship. Rendering is done automatically, using this VirtualSurface as an intermediate SDL_Surface, in a efficient way.
| void VirtualSurface::addChild | ( | Surface * | child | ) |
Add a child to this VirtualSurface.
| child | Child to add. |
| void VirtualSurface::enable | ( | ) | [virtual] |
Enable this widget.
Reimplemented from Surface.
Reimplemented in sdlvisu::DialogBox.
| int VirtualSurface::getNbChild | ( | ) | const |
Get the number of child currently contained by this VirtualSurface.
Set a marker on a rectangle that must be redrawn next time.
To call when a visual change has occured in this rectangle (like adding, moving or removing a sprite).
| pos | A top-left point relative to this VirtualSurface position. | |
| size | The size of the invalidated rectangle. |
| void VirtualSurface::invalidate | ( | const Rect & | zone | ) |
Set a marker on a rectangle that must be redrawn next time.
To call when a visual change has occured in this rectangle (like adding, moving or removing a sprite).
| zone | A rectangle relative to this VirtualSurface position. |
| void VirtualSurface::removeChild | ( | Surface * | child | ) |
| void VirtualSurface::render | ( | ) | [virtual] |
Private method.
Called after update round, to effectively render images. Don't override it, should only be used by VirtualSurface.
Reimplemented from Surface.
| void VirtualSurface::show | ( | ) | [virtual] |
Show this surface on the screen.
Reimplemented from Surface.
Reimplemented in sdlvisu::ActionPopup.
| void VirtualSurface::update | ( | ) | [virtual] |
Method called each frame, to perfom user custom code.
You should override it.
Since a parent is assigned to the surface (and this parent is itself attached by other means to the root screen), this method is called at each frame. It is not called if this surface or one of its parent is disabled. In this method you can do what you want with your object, like processing input, updating other programs attributes, changing surface property, ...
Reimplemented from Surface.
Reimplemented in VirtualScrollableSurface, sdlvisu::ActionPopup, sdlvisu::DialogBox, sdlvisu::VisuField, and sdlvisu::Panel.
| void VirtualSurface::updateChildZOrder | ( | ) |
Private method, you shouldn't need that.
Update child Z-order in children vector, when a child change its Z attribute.
1.4.7