|
|
| device_shared (gfx_device_vulkan const &device) |
| |
|
| device_shared (device_shared const &)=delete |
| |
|
device_shared & | operator= (device_shared const &)=delete |
| |
|
| device_shared (device_shared &&)=delete |
| |
|
device_shared & | operator= (device_shared &&)=delete |
| |
| void | destroy (gfx_device_vulkan *vulkanDevice) |
| |
| atlas_rect | allocateRect (extent2 drawExtent) noexcept |
| | Allocate an glyph in the atlas.
|
| |
|
void | drawInCommandBuffer (vk::CommandBuffer &commandBuffer) |
| |
| void | uploadStagingPixmapToAtlas (atlas_rect 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 (shaped_text const &text) noexcept |
| | Prepare the atlas for drawing a text.
|
| |
| void | place_vertices (vspan< vertex > &vertices, aarectangle clipping_rectangle, rectangle box, font_glyph_ids const &glyphs, color color) noexcept |
| | Place vertices for a single glyph.
|
| |
| void | place_vertices (vspan< vertex > &vertices, aarectangle clipping_rectangle, matrix3 transform, shaped_text const &text) noexcept |
| | Draw the text on the screen.
|
| |
| void | place_vertices (vspan< vertex > &vertices, aarectangle clipping_rectangle, matrix3 transform, shaped_text const &text, color 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 = sdf_r8::max_distance |
| |
|
static constexpr float | scaledDrawBorder = drawBorder / drawfontSize |
| |
◆ allocateRect()
Allocate an glyph in the atlas.
This may allocate an atlas texture, up to atlasMaximumNrImages.
◆ destroy()
◆ getBoundingBox()
Get the bounding box, including draw border of a glyph.
◆ place_vertices() [1/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. |
◆ place_vertices() [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. |
| color | Override the color of the text to draw. |
◆ place_vertices() [3/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. |
◆ prepareAtlas()
| void tt::pipeline_SDF::device_shared::prepareAtlas |
( |
shaped_text const & | text | ) |
|
|
noexcept |
Prepare the atlas for drawing a text.
◆ prepareAtlasForRendering()
| void tt::pipeline_SDF::device_shared::prepareAtlasForRendering |
( |
| ) |
|
This will transition the atlas to 'shader-read'.
◆ prepareStagingPixmapForDrawing()
| void tt::pipeline_SDF::device_shared::prepareStagingPixmapForDrawing |
( |
| ) |
|
This will transition the staging texture to 'general' for writing by the CPU.
◆ uploadStagingPixmapToAtlas()
| void tt::pipeline_SDF::device_shared::uploadStagingPixmapToAtlas |
( |
atlas_rect | 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::pipeline_SDF::device_shared::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: