AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
SoftwareRenderer Class Reference

Member Function Documentation

> All members, including inherited

◆ boxShadow()

void SoftwareRenderer::boxShadow ( glm::vec2 position,
glm::vec2 size,
float blurRadius,
const AColor & color )
overridevirtual
Parameters
positionposition
sizerectangle size
blurRadiusblur radius
colorshadow color

Implements IRenderer.

◆ boxShadowInner()

void SoftwareRenderer::boxShadowInner ( glm::vec2 position,
glm::vec2 size,
float blurRadius,
float spreadRadius,
float borderRadius,
const AColor & color,
glm::vec2 offset )
overridevirtual
Parameters
positionposition
sizerectangle size
blurRadiusblur radius
spreadRadiusspread (offset) radius
borderRadiusborder radius of the rectangle.
colorshadow color
offsetshadow offset. Unlike outer shadow (ctx.render.boxShadow), the offset is passed to the shader instead of a simple rectangle position offset.

Implements IRenderer.

◆ createNewTexture()

_unique< ITexture > SoftwareRenderer::createNewTexture ( )
overrideprotectedvirtual

Implements IRenderer.

◆ getProjectionMatrix()

glm::mat4 SoftwareRenderer::getProjectionMatrix ( ) const
overridevirtual

Implements IRenderer.

◆ lines() [1/2]

void SoftwareRenderer::lines ( const ABrush & brush,
AArrayView< glm::vec2 > points,
const ABorderStyle & style,
AMetric width )
overridevirtual
Parameters
brushbrush
pointspolyline points
stylestyle
widthline width

Implements IRenderer.

◆ lines() [2/2]

void SoftwareRenderer::lines ( const ABrush & brush,
AArrayView< std::pair< glm::vec2, glm::vec2 > > points,
const ABorderStyle & style,
AMetric width )
overridevirtual
Parameters
brushbrush
pointsline points
stylestyle
widthline width

Implements IRenderer.

◆ newMultiStringCanvas()

_< IMultiStringCanvas > SoftwareRenderer::newMultiStringCanvas ( const AFontStyle & style)
overridevirtual
Returns
a new instance of IMultiStringCanvas

Implements IRenderer.

◆ newRenderViewToTexture()

_unique< IRenderViewToTexture > SoftwareRenderer::newRenderViewToTexture ( )
overridevirtualnoexcept
Returns
A new instance. Can return null if unsupported.

Implements IRenderer.

◆ points()

void SoftwareRenderer::points ( const ABrush & brush,
AArrayView< glm::vec2 > points,
AMetric size )
overridevirtual
Parameters
brushbrush
pointspoints
sizepoint size

Implements IRenderer.

◆ popMaskAfter()

void SoftwareRenderer::popMaskAfter ( )
overridevirtual

Stencil buffer should not be changed after calling this function. Should be called after the popMaskBefore function.

Implements IRenderer.

◆ popMaskBefore()

void SoftwareRenderer::popMaskBefore ( )
overridevirtual

Stencil pixel is decreased by each affected pixel. Should be called before the popMaskAfter function.

Implements IRenderer.

◆ prerenderString()

_< IPrerenderedString > SoftwareRenderer::prerenderString ( glm::vec2 position,
const AString & text,
const AFontStyle & fs )
overridevirtual
Parameters
positionstring's top left point
textstring to prerender
fsfont style
Returns
an instance of IPrerenderedString

Implements IRenderer.

◆ pushMaskAfter()

void SoftwareRenderer::pushMaskAfter ( )
overridevirtual

Stencil buffer should not be changed after calling this function. Should be called after the pushMaskBefore function.

Implements IRenderer.

◆ pushMaskBefore()

void SoftwareRenderer::pushMaskBefore ( )
overridevirtual

Stencil pixel is increased by each affected pixel. Should be called before the pushMaskAfter function.

Implements IRenderer.

◆ putPixel()

void SoftwareRenderer::putPixel ( glm::ivec2 position,
AColor color,
AOptional< Blending > blending = std::nullopt )
inlinenoexcept

Draws a pixel onto the software framebuffer following the stencil and blending rules.

Sneaky assertions
position is inside the framebuffer.
Parameters
positionposition. An assertion is triggered if position is not inside the framebuffer.
colorcolor.
blendingblending. Optional. Cheaper. When set, the one set by the setBlending function is ignored.

◆ rectangle()

void SoftwareRenderer::rectangle ( const ABrush & brush,
glm::vec2 position,
glm::vec2 size )
overridevirtual
Parameters
brushbrush to use
positionrectangle position (px)
sizerectangle size (px)

Implements IRenderer.

◆ rectangleBorder()

void SoftwareRenderer::rectangleBorder ( const ABrush & brush,
glm::vec2 position,
glm::vec2 size,
float lineWidth )
overridevirtual
Parameters
brushbrush to use
positionrectangle position (px)
sizerectangle size (px)
lineWidthborder line width (px)

Implements IRenderer.

◆ roundedRectangle()

void SoftwareRenderer::roundedRectangle ( const ABrush & brush,
glm::vec2 position,
glm::vec2 size,
float radius )
overridevirtual
Parameters
brushbrush to use
positionrectangle position (px)
sizerectangle size (px)
radiuscorner radius (px)

Implements IRenderer.

◆ roundedRectangleBorder()

void SoftwareRenderer::roundedRectangleBorder ( const ABrush & brush,
glm::vec2 position,
glm::vec2 size,
float radius,
int borderWidth )
overridevirtual
Parameters
brushbrush to use
positionrectangle position (px)
sizerectangle size (px)
radiuscorner radius (px)
borderWidthborder line width (px)

Implements IRenderer.

◆ setBlending()

void SoftwareRenderer::setBlending ( Blending blending)
overridevirtual
Parameters
blendingnew blending mode

Implements IRenderer.

◆ setWindow()

void SoftwareRenderer::setWindow ( AWindowBase * window)
overridevirtual
Parameters
windowtarget window

Reimplemented from IRenderer.

◆ squareSector()

void SoftwareRenderer::squareSector ( const ABrush & brush,
const glm::vec2 & position,
const glm::vec2 & size,
AAngleRadians begin,
AAngleRadians end )
overridevirtual
Parameters
brushbrush to use
positionrectangle position (px)
sizerectangle size (px)
beginbegin angle of the sector
endend angle of the sector

The method can be used as mask to ctx.render.roundedRect, creating arc shape.

Implements IRenderer.

◆ string()

void SoftwareRenderer::string ( glm::vec2 position,
const AString & string,
const AFontStyle & fs )
overridevirtual
Parameters
positionstring's top left point
stringstring to render
fsfont style (optional)
Note
This function is dramatically inefficient since it does symbol lookup for every character is the string and does GPU buffer allocations. If you want to render the same string for several times (frames), consider using the IRenderer::prerenderString function or high level views (such as ALabel) instead.

Implements IRenderer.