|
TachyonUI 0.1.0
High-performance UI for building tools.
|
#include <gui_core/graphics/gui_renderer.h>
Public Member Functions | |
| virtual | ~GUIRenderer () |
| virtual void | Reset ()=0 |
| virtual void | SetTransform (tachyon::float3x2 transformation)=0 |
| virtual void | SetOpacity (float) |
| How opaque what is drawn from now on is, 0 to 1 (1 until set). | |
| virtual void | RenderBox (tachyon::IntRect rect, tachyon::IntRect clipRect, uint32_t fromStyleIndex, uint32_t toStyleIndex, float blendT, tachyon::VisualColorStyleIndex colorStyleIndex={}, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, tachyon::IntRect snappedPx={})=0 |
| Draws a styled box, blended from fromStyleIndex to toStyleIndex (flat GPU style indices) by blendT in [0, 1]. | |
| void | RenderBox (tachyon::IntRect rect, tachyon::IntRect clipRect, VisualBoxStyleIndex boxStyleIndex, tachyon::ElementState state, tachyon::VisualColorStyleIndex colorStyleIndex={}, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, tachyon::IntRect snappedPx={}) |
| void | RenderBox (tachyon::IntRect rect, tachyon::IntRect clipRect, VisualBoxStyleIndex boxStyleIndex, tachyon::VisualColorStyleIndex colorStyleIndex={}, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, tachyon::IntRect snappedPx={}) |
| virtual void | RenderLine (tachyon::int2 p0, tachyon::int2 p1, tachyon::int2 p2, tachyon::int2 p3, tachyon::IntRect clipRect, const LineStyle &lineStyle)=0 |
| void | RenderLine (tachyon::int2 p0, tachyon::int2 p1, tachyon::IntRect clipRect, const LineStyle &lineStyle) |
| virtual void | RenderCircle (tachyon::float2 center, float radius, tachyon::IntRect clipRect, const LineStyle &lineStyle)=0 |
| A circle outline lineStyle.lineWidth wide, exactly round. | |
| virtual void | RenderDot (tachyon::float2 pos, tachyon::IntRect clipRect, float size, tachyon::color4f color)=0 |
| virtual void | RenderTriangle (tachyon::float2 p0, tachyon::float2 p1, tachyon::float2 p2, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, TriangleEdges hardEdges=TriangleEdges::None)=0 |
| A filled triangle. | |
| virtual void | RenderQuad (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius=0.0f, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid)=0 |
| Draws a filled, optionally rounded and textured rect: a box without borders, style blending or element state. | |
| virtual void | RenderShadow (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius, int blur)=0 |
| A box shadow: rect is the shadow's shape, which fades out over blur pixels on either side of its edge (Gaussian, sigma = blur / 2, as CSS). | |
| virtual void | RenderOccluder (tachyon::IntRect, tachyon::IntRect) |
| Draws nothing: marks rect as covered by opaque content drawn after this call, so what was drawn before it there is skipped on the GPU. | |
| virtual void | RenderGlyph (tachyon::float2 pos, tachyon::float2 size, tachyon::float2 uvMin, tachyon::float2 uvMax, float scale, int bpp, int mode, VisualColorStyleIndex textColorIndex, tachyon::IntRect clipRect, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, float shadowBlur=-1.0f)=0 |
| A glyph from the text atlas. | |
| void | RenderFilledPolygon (std::span< const tachyon::float2 > points, tachyon::IntRect clipRect, VisualColorStyleIndex colorIndex, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid) |
| Convex polygon, fan-triangulated from points[0]; needs at least 3 points. | |
| void | RenderPolyline (std::span< const tachyon::int2 > points, bool closed, tachyon::IntRect clipRect, const LineStyle &style) |
| Outlined polyline; closed adds a segment from the last point back to the first. | |
| virtual bool | StartResizing (ID id)=0 |
| virtual void | StopResizing ()=0 |
| virtual bool | BeginWindow (ID id)=0 |
| virtual void | EndWindow ()=0 |
| virtual void | BeginScopeCapture (ID) |
| Starts recording primitives under scopeId, replacing its previous capture. | |
| virtual void | EndScopeCapture (ID) |
| Ends the capture of scopeId and draws it into the current window. | |
| virtual bool | ReplayScopeCapture (ID, tachyon::int2) |
| Draws the capture of scopeId again, moved by delta pixels; false if there is none. | |
| virtual bool | HasScopeCapture (ID) const |
| True when scopeId has a non-empty capture. | |
| virtual void | InvalidateScopeCapture (ID) |
| Drops the capture of scopeId. | |
| virtual void | ClearScopeCaptures () |
| Drops every capture. | |
Static Public Member Functions | |
| static uint32_t | StyleIndex (VisualBoxStyleIndex boxStyleIndex, tachyon::ElementState state) |
| The flat GPU style index of boxStyleIndex in state, as RenderBox takes it. | |
|
inlinevirtual |
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
How opaque what is drawn from now on is, 0 to 1 (1 until set).
Below 1, occluders are dropped: what is under the drawing shows through it.
Reimplemented in tachyon::PrimitiveRenderer.
|
pure virtual |
Draws a styled box, blended from fromStyleIndex to toStyleIndex (flat GPU style indices) by blendT in [0, 1].
colorStyleIndex overrides the background (Invalid: none). snappedPx is the box in window pixels snapped relative to its parent (SnapToParent); empty snaps the transformed rect to the pixel grid.
Implemented in tachyon::PrimitiveRenderer.
|
static |
The flat GPU style index of boxStyleIndex in state, as RenderBox takes it.
| void tachyon::GUIRenderer::RenderBox | ( | tachyon::IntRect | rect, |
| tachyon::IntRect | clipRect, | ||
| VisualBoxStyleIndex | boxStyleIndex, | ||
| tachyon::ElementState | state, | ||
| tachyon::VisualColorStyleIndex | colorStyleIndex = {}, | ||
| tachyon::ImageIndex | textureIndex = tachyon::ImageIndex::Invalid, | ||
| tachyon::IntRect | snappedPx = {} ) |
| void tachyon::GUIRenderer::RenderBox | ( | tachyon::IntRect | rect, |
| tachyon::IntRect | clipRect, | ||
| VisualBoxStyleIndex | boxStyleIndex, | ||
| tachyon::VisualColorStyleIndex | colorStyleIndex = {}, | ||
| tachyon::ImageIndex | textureIndex = tachyon::ImageIndex::Invalid, | ||
| tachyon::IntRect | snappedPx = {} ) |
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
inline |
|
pure virtual |
A circle outline lineStyle.lineWidth wide, exactly round.
A gradient and dashes run clockwise from the right (+x towards +y); gradientOffset / gradientScale pick the part of the gradient that goes once around.
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
A filled triangle.
hardEdges end without a soft edge, for edges it shares with another triangle of the same shape.
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
Draws a filled, optionally rounded and textured rect: a box without borders, style blending or element state.
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
A box shadow: rect is the shadow's shape, which fades out over blur pixels on either side of its edge (Gaussian, sigma = blur / 2, as CSS).
Implemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
Draws nothing: marks rect as covered by opaque content drawn after this call, so what was drawn before it there is skipped on the GPU.
Only for a rect the later content covers completely, with no anti-aliased edge.
Reimplemented in tachyon::PrimitiveRenderer.
|
pure virtual |
A glyph from the text atlas.
scale is atlas texels per pixel. With a shadowBlur of 0 or more it is a text shadow instead: the glyph's shape in textColorIndex alone (a color glyph's too), blurred by that many pixels (Gaussian, sigma = blur / 2, as CSS) as far as the atlas' distance field reaches.
Implemented in tachyon::PrimitiveRenderer.
| void tachyon::GUIRenderer::RenderFilledPolygon | ( | std::span< const tachyon::float2 > | points, |
| tachyon::IntRect | clipRect, | ||
| VisualColorStyleIndex | colorIndex, | ||
| tachyon::ImageIndex | textureIndex = tachyon::ImageIndex::Invalid ) |
Convex polygon, fan-triangulated from points[0]; needs at least 3 points.
| void tachyon::GUIRenderer::RenderPolyline | ( | std::span< const tachyon::int2 > | points, |
| bool | closed, | ||
| tachyon::IntRect | clipRect, | ||
| const LineStyle & | style ) |
Outlined polyline; closed adds a segment from the last point back to the first.
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
pure virtual |
Implemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
Starts recording primitives under scopeId, replacing its previous capture.
Captures don't nest.
Reimplemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
Ends the capture of scopeId and draws it into the current window.
Reimplemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
Draws the capture of scopeId again, moved by delta pixels; false if there is none.
Reimplemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
True when scopeId has a non-empty capture.
Reimplemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
Drops the capture of scopeId.
Reimplemented in tachyon::PrimitiveRenderer.
|
inlinevirtual |
Drops every capture.
Reimplemented in tachyon::PrimitiveRenderer.