![]() |
Lysa
0.0
Lysa 3D Engine
|
Renderer for 2D vector graphics
Inheritance diagram for Vector2DRenderer:Public Member Functions | |
| Vector2DRenderer (const RendererConfiguration &config, vireo::ImageFormat outputFormat) | |
| auto | getAspectRatio () const |
| void | drawLine (const float2 &start, const float2 &end) |
| void | drawLine (const float2 &start, const float2 &end, float width) |
| void | drawRect (const Rect &rect) |
| void | drawRect (const Rect &rect, unique_id imageId) |
| void | drawRect (float x, float y, float w, float h, unique_id imageId=INVALID_ID) |
| void | drawCircle (const float2 ¢er, float radius, float borderWidth=0.0f) |
| void | drawCircle (float x, float y, float radius, float borderWidth=0.0f) |
| void | drawRoundedRect (const Rect &rect, float cornerRadius, float borderWidth=0.0f) |
| void | drawRoundedRect (const Rect &rect, unique_id imageId, float cornerRadius, float borderWidth=0.0f) |
| void | drawRoundedRect (float x, float y, float w, float h, float cornerRadius, float borderWidth=0.0f, unique_id imageId=INVALID_ID) |
| void | drawSVG (const SVG &svg, const Rect &rect, float borderWidth=0.0f) |
| void | drawSVG (const SVG &svg, float x, float y, float w, float h, float borderWidth=0.0f) |
| void | drawText (const std::string &text, Font &font, float fontScale, float x, float y) |
| void | drawText (const std::string &text, Font &font, float fontScale, float x, float y, const Rect &clipRect) |
| auto | setPenColor (const float4 &color) |
| auto | setTranslate (const float2 &t) |
| auto | setTransparency (const float a) |
Public Member Functions inherited from Vector3DRenderer | |
| Vector3DRenderer (const RendererConfiguration &config, vireo::ImageFormat outputFormat, bool useCamera=true, bool depthTestEnable=true, bool filledTriangles=false, bool enableAlphaBlending=true, const std::string &name="VectorRenderer", const std::string &shadersName="vector", const std::string &glyphShadersName="glyph") | |
| bool | isUseCamera () const |
| unique_id | beginDraw (unique_id sessionId=INVALID_ID, uint32 layer=0) |
| void | endDraw () |
| void | setVisible (unique_id sessionId, bool visible) |
| void | clearSession (unique_id sessionId) |
| void | restart () |
| void | drawLine (const float3 &from, const float3 &to, const float4 &color) |
| void | drawTriangle (const float3 &v1, const float3 &v2, const float3 &v3, const float4 &color) |
| void | drawImage (unique_id imageId, const float3 &position, const quaternion &rotation, const float2 &size, const float4 &color) |
| void | drawCircle (const float3 ¢er, const quaternion &rotation, float radius, const float4 &color, float borderWidth=0.0f) |
| void | drawRoundedQuad (const float3 ¢er, const quaternion &rotation, const float2 &size, float cornerRadius, const float4 &color, float borderWidth=0.0f) |
| void | drawSVG (const SVG &svg, const float3 ¢er, const quaternion &rotation, const float2 &size, const float4 &color, float borderWidth=0.0f) |
| void | drawText (const std::string &text, Font &font, float fontScale, const float3 &position, const quaternion &rotation, const float4 &innerColor, TextAlignment alignment=TextAlignment::LEFT, bool rotationGlobal=false) |
| void | drawSpline (const std::vector< float3 > &points, const float4 &color, uint32 segsPerSpan=16, float tension=0.0f) |
| void | update (const std::shared_ptr< vireo::CommandList > &commandList, uint32 frameIndex) |
| void | resize (const vireo::Extent &extent) |
| void | render (const std::shared_ptr< vireo::CommandList > &commandList, const Camera &camera, const std::shared_ptr< vireo::RenderTarget > &colorAttachment, const std::shared_ptr< vireo::RenderTarget > &depthAttachment, uint32 frameIndex, const vireo::Extent &extent={0, 0}) |
| void | setGammaCorrectionParameters (const float gamma, const float _) |
| virtual | ~Vector3DRenderer () |
| Vector3DRenderer (Vector3DRenderer &) = delete | |
| Vector3DRenderer & | operator= (Vector3DRenderer &) = delete |
Additional Inherited Members | |
Protected Member Functions inherited from Vector3DRenderer | |
| void | commitPrimitive (DrawPrimType type, uint32 vertexCount) |
| void | drawQuad (const float3 &v0, const float3 &v1, const float3 &v2, const float3 &v3, DrawParam param, const float2 &uv0={0.0f, 0.0f}, const float2 &uv1={1.0f, 1.0f}) |
| int32 | addImage (const Image &texture) |
| int32 | addFontAtlas (const Image &texture) |
| int32 | addFont (Font &font) |
| bool | addSVG (const SVG &svg, DrawParam ¶m) |
Protected Attributes inherited from Vector3DRenderer | |
| const std::string | name |
| const size_t | maxVertices |
| const size_t | maxParams |
| const size_t | maxImages |
| const size_t | maxFonts |
| const size_t | maxSdfSegments |
| ImageManager & | imageManager |
| const RendererConfiguration & | config |
| float | aspectRatio {} |
| std::vector< Vertex > | vertices |
| uint32 | nextVertexOffset {0} |
| std::vector< DrawParam > | params |
| uint32 | nextParamOffset {0} |
| std::vector< SVG::Segment > | sdfSegments |
| uint32 | nextSdfSegmentOffset {0} |
| std::map< unique_id, std::pair< uint32, uint32 > > | sdfSegmentsRanges |
| uint32 | lineListCount {0} |
| uint32 | lineStripCount {0} |
| uint32 | triPlainCount {0} |
| uint32 | triImageCount {0} |
| uint32 | triGlyphCount {0} |
| std::array< uint32, 5 > | typeCounts {} |
| std::optional< DrawSession > | currentSession |
| Vector2DRenderer | ( | const RendererConfiguration & | config, |
| vireo::ImageFormat | outputFormat | ||
| ) |
Constructs a new Vector2DRenderer
| config | The renderer configuration |
| outputFormat | Output attachment color format |
| void drawCircle | ( | const float2 & | center, |
| float | radius, | ||
| float | borderWidth = 0.0f |
||
| ) |
Draws a circle (rasterized by the fragment shader with an antialiased edge)
| center | The center of the circle |
| radius | The radius of the circle |
| borderWidth | Width of the border, 0 to fill the circle |
| void drawCircle | ( | float | x, |
| float | y, | ||
| float | radius, | ||
| float | borderWidth = 0.0f |
||
| ) |
Draws a circle (rasterized by the fragment shader with an antialiased edge)
| x | The x-coordinate of the center of the circle |
| y | The y-coordinate of the center of the circle |
| radius | The radius of the circle |
| borderWidth | Width of the border, 0 to fill the circle |
| void drawLine | ( | const float2 & | start, |
| const float2 & | end | ||
| ) |
Draws a 1-fragment width line
| void drawLine | ( | const float2 & | start, |
| const float2 & | end, | ||
| float | width | ||
| ) |
Draws a line of a given width with round caps (rasterized by the fragment shader with an antialiased edge)
| start | The first end of the line |
| end | The second end of the line |
| width | Width of the line, in vertical units |
| void drawRect | ( | const Rect & | rect | ) |
Draws a filled rectangle
Draws a filled rectangle with an image texture
| void drawRect | ( | float | x, |
| float | y, | ||
| float | w, | ||
| float | h, | ||
| unique_id | imageId = INVALID_ID |
||
| ) |
Draws a filled rectangle with an optional texture
| x | The x-coordinate of the rectangle |
| y | The y-coordinate of the rectangle |
| w | The width of the rectangle |
| h | The height of the rectangle |
| imageId | The unique ID of the image to use (defaults to INVALID_ID) |
| void drawRoundedRect | ( | const Rect & | rect, |
| float | cornerRadius, | ||
| float | borderWidth = 0.0f |
||
| ) |
Draws a rectangle with rounded corners (rasterized by the fragment shader with an antialiased edge)
| rect | The rectangle |
| cornerRadius | The radius of the corners, clamped to half of the smallest side |
| borderWidth | Width of the border, 0 to fill the rectangle |
| void drawRoundedRect | ( | const Rect & | rect, |
| unique_id | imageId, | ||
| float | cornerRadius, | ||
| float | borderWidth = 0.0f |
||
| ) |
Draws a rectangle with rounded corners and an image texture
| rect | The rectangle |
| imageId | The unique ID of the image to use |
| cornerRadius | The radius of the corners, clamped to half of the smallest side |
| borderWidth | Width of the border, 0 to fill the rectangle |
| void drawRoundedRect | ( | float | x, |
| float | y, | ||
| float | w, | ||
| float | h, | ||
| float | cornerRadius, | ||
| float | borderWidth = 0.0f, |
||
| unique_id | imageId = INVALID_ID |
||
| ) |
Draws a rectangle with rounded corners and an optional texture
| x | The x-coordinate of the rectangle |
| y | The y-coordinate of the rectangle |
| w | The width of the rectangle |
| h | The height of the rectangle |
| cornerRadius | The radius of the corners, clamped to half of the smallest side |
| borderWidth | Width of the border, 0 to fill the rectangle |
| imageId | The unique ID of the image to use (defaults to INVALID_ID) |
Draws an SVG shape
| svg | The shape to draw |
| rect | The rectangle the shape is fitted into |
| borderWidth | Width of the border, 0 to fill the shape |
| void drawSVG | ( | const SVG & | svg, |
| float | x, | ||
| float | y, | ||
| float | w, | ||
| float | h, | ||
| float | borderWidth = 0.0f |
||
| ) |
Draws an SVG shape
| svg | The shape to draw |
| x | The x-coordinate of the rectangle the shape is fitted into |
| y | The y-coordinate of the rectangle the shape is fitted into |
| w | The width of the rectangle the shape is fitted into |
| h | The height of the rectangle the shape is fitted into |
| borderWidth | Width of the border, 0 to fill the shape |
| void drawText | ( | const std::string & | text, |
| Font & | font, | ||
| float | fontScale, | ||
| float | x, | ||
| float | y | ||
| ) |
Draws text on the screen
| text | The text string to draw |
| font | The font to use for drawing |
| fontScale | The scale of the font |
| x | The x-coordinate where the text starts |
| y | The y-coordinate where the text starts |
| void drawText | ( | const std::string & | text, |
| Font & | font, | ||
| float | fontScale, | ||
| float | x, | ||
| float | y, | ||
| const Rect & | clipRect | ||
| ) |
Draws text on the screen, clipped to a rectangle
| text | The text string to draw |
| font | The font to use for drawing |
| fontScale | The scale of the font |
| x | The x-coordinate where the text starts |
| y | The y-coordinate where the text starts |
| clipRect | The clipping rectangle |
|
inline |
Gets the aspect ratio of the renderer
|
inline |
Changes the color of the fragments for the next drawing commands
|
inline |
Changes the [x,y] translation for the next drawing commands
|
inline |
Changes the global transparency for the next drawing commands
The value is subtracted from the vertex alpha