bWidgets
Core widget toolkit designed for Blender
|
Main interface to implement any drawing of geometry or text. More...
#include <bwPaintEngine.h>
Public Member Functions | |
virtual | ~bwPaintEngine ()=default |
virtual void | setupViewport (const bwRectanglePixel &rect, const class bwColor &clear_color)=0 |
virtual void | enableMask (const bwRectanglePixel &rect)=0 |
virtual void | drawPolygon (const class bwPainter &painter, const class bwPolygon &polygon)=0 |
virtual void | drawText (const class bwPainter &painter, const std::string &text, const bwRectanglePixel &rect, const TextAlignment alignment)=0 |
virtual void | drawIcon (const class bwPainter &painter, const class bwIconInterface &icon_interface, const bwRectanglePixel &rect)=0 |
Main interface to implement any drawing of geometry or text.
bwPaintEngine mainly gives us two benefits:
Having support for multiple drawing backends is not only useful for supporting multiple graphics libraries (as in OpenGL, DirectX, Vulcan, etc.), but also to draw on different mediums. E.g. for drawing into textures or exporting as HTML & CSS code.
Creating a paint-engine is done by subclassing this class and implementing the abstract functions.
|
virtualdefault |
|
pure virtual |
Draw the icon referenced by icon_interface.
painter | Provides all aditional information needed for drawing (e.g. color for theme controlled monochrome icons etc.). |
rect | The bounding-box to draw the icon into. |
|
pure virtual |
The main polygon draw function which is used to draw all geometry of widgets.
painter | Provides all aditional information needed for drawing (color, draw-style, etc.). |
|
pure virtual |
The main text draw function which is used to draw all text of widgets.
painter | Provides all aditional information needed for drawing (color, draw-style, etc.). |
rect | The bounding-box to draw the text into. |
|
pure virtual |
|
pure virtual |
Setup function for application to prepare viewport (prepare matrices, clear background, etc.) for drawing.
rect | The rectangle defining the viewport location and size. |
clear_color | Color to be used for buffer clearing. |