|
|
| DeviceShared (GUIDevice const &device) |
| |
|
| DeviceShared (DeviceShared const &)=delete |
| |
|
DeviceShared & | operator= (DeviceShared const &)=delete |
| |
|
| DeviceShared (DeviceShared &&)=delete |
| |
|
DeviceShared & | operator= (DeviceShared &&)=delete |
| |
| void | destroy (GUIDevice *vulkanDevice) |
| |
| AtlasRect | allocateRect (vec drawExtent) noexcept |
| | Allocate an glyph in the atlas.
|
| |
|
void | drawInCommandBuffer (vk::CommandBuffer &commandBuffer) |
| |
| void | uploadStagingPixmapToAtlas (AtlasRect location) |
| | Once drawing in the staging pixmap is completed, you can upload it to the atlas.
|
| |
| void | prepareStagingPixmapForDrawing () |
| | This will transition the staging texture to 'general' for writing by the CPU.
|
| |
| void | prepareAtlasForRendering () |
| | This will transition the atlas to 'shader-read'.
|
| |
| void | prepareAtlas (ShapedText const &text) noexcept |
| | Prepare the atlas for drawing a text.
|
| |
| void | placeVertices (vspan< Vertex > &vertices, FontGlyphIDs const &glyphs, rect box, vec color, aarect clippingRectangle) noexcept |
| | Place vertices for a single glyph.
|
| |
| void | placeVertices (vspan< Vertex > &vertices, ShapedText const &text, mat transform, aarect clippingRectangle) noexcept |
| | Draw the text on the screen.
|
| |
| void | placeVertices (vspan< Vertex > &vertices, ShapedText const &text, mat transform, aarect clippingRectangle, vec color) noexcept |
| | Draw the text on the screen.
|
| |
|
|
static constexpr int | atlasImageWidth = 1024 |
| |
|
static constexpr int | atlasImageHeight = 1024 |
| |
|
static constexpr int | atlasMaximumNrImages = 16 |
| |
|
static constexpr int | stagingImageWidth = 128 |
| |
|
static constexpr int | stagingImageHeight = 128 |
| |
|
static constexpr float | atlasTextureCoordinateMultiplier = 1.0f / atlasImageWidth |
| |
|
static constexpr float | drawFontSize = 28.0f |
| |
|
static constexpr float | drawBorder = SDF8::max_distance |
| |
|
static constexpr float | scaledDrawBorder = drawBorder / drawFontSize |
| |
◆ allocateRect()
| AtlasRect tt::PipelineSDF::DeviceShared::allocateRect |
( |
vec | drawExtent | ) |
|
|
noexcept |
Allocate an glyph in the atlas.
This may allocate an atlas texture, up to atlasMaximumNrImages.
◆ destroy()
| void tt::PipelineSDF::DeviceShared::destroy |
( |
GUIDevice * | vulkanDevice | ) |
|
◆ getBoundingBox()
| static aarect tt::PipelineSDF::DeviceShared::getBoundingBox |
( |
FontGlyphIDs const & | glyphs | ) |
|
|
staticnoexcept |
Get the bounding box, including draw border of a glyph.
◆ placeVertices() [1/3]
Place vertices for a single glyph.
- Parameters
-
| vertices | The list of vertices to add to. |
| glyphs | The font-id, composed-glyphs to render |
| box | The rectangle of the glyph in window coordinates; including the draw border. |
| color | The color of the glyph. |
| clippingRectangle | The rectangle to clip the glyph. |
◆ placeVertices() [2/3]
Draw the text on the screen.
- Parameters
-
| text | The box of text to draw |
| transform | The 2D transformation to move and rotate the box to the correct position on screen. |
| clippingRectangle | The clipping rectangle in screen space where glyphs should be cut off. |
| vertices | The vertices to draw the glyphs to. |
◆ placeVertices() [3/3]
Draw the text on the screen.
- Parameters
-
| text | The box of text to draw |
| transform | The 2D transformation to move and rotate the box to the correct position on screen. |
| clippingRectangle | The clipping rectangle in screen space where glyphs should be cut off. |
| vertices | The vertices to draw the glyphs to. |
| color | Override the color of the text to draw. |
◆ prepareAtlas()
| void tt::PipelineSDF::DeviceShared::prepareAtlas |
( |
ShapedText const & | text | ) |
|
|
noexcept |
Prepare the atlas for drawing a text.
◆ prepareAtlasForRendering()
| void tt::PipelineSDF::DeviceShared::prepareAtlasForRendering |
( |
| ) |
|
This will transition the atlas to 'shader-read'.
◆ prepareStagingPixmapForDrawing()
| void tt::PipelineSDF::DeviceShared::prepareStagingPixmapForDrawing |
( |
| ) |
|
This will transition the staging texture to 'general' for writing by the CPU.
◆ uploadStagingPixmapToAtlas()
| void tt::PipelineSDF::DeviceShared::uploadStagingPixmapToAtlas |
( |
AtlasRect | location | ) |
|
Once drawing in the staging pixmap is completed, you can upload it to the atlas.
This will transition the stating texture to 'source' and the atlas to 'destination'.
◆ atlasAllocationMaxHeight
| int tt::PipelineSDF::DeviceShared::atlasAllocationMaxHeight = 0 |
During allocation on a row, we keep track of the tallest glyph.
The documentation for this struct was generated from the following file: