font implementation in vulkan.
More...
#include <vulkanTexture.h>
|
| void | createFontTexture () |
| | allocates and creates the atlas texture from wich glyph can be sampled from. More...
|
| |
| stbi_uc * | createGlyph (const stbtt_fontinfo *info, int codePoint, float *xscale, float *yscale, int *newXoff, int *newYoff) |
| | creates a font glyph and gurantees the texture height and width to be 300 by 300 pixels. More...
|
| |
| void | writeGlyphsIntoBuffer () |
| |
|
| static const int | width = 4800 |
| |
| static const int | height = 4800 |
| |
font implementation in vulkan.
◆ vulkanFont()
| luna::vulkan::vulkanFont::vulkanFont |
( |
const std::string & |
filePath | ) |
|
◆ ~vulkanFont()
| virtual luna::vulkan::vulkanFont::~vulkanFont |
( |
| ) |
|
|
virtualdefault |
◆ createFontTexture()
| void luna::vulkan::vulkanFont::createFontTexture |
( |
| ) |
|
|
private |
allocates and creates the atlas texture from wich glyph can be sampled from.
◆ createGlyph()
| stbi_uc * luna::vulkan::vulkanFont::createGlyph |
( |
const stbtt_fontinfo * |
info, |
|
|
int |
codePoint, |
|
|
float * |
xscale, |
|
|
float * |
yscale, |
|
|
int * |
newXoff, |
|
|
int * |
newYoff |
|
) |
| |
|
private |
creates a font glyph and gurantees the texture height and width to be 300 by 300 pixels.
- Parameters
-
| const | stbtt_fontinfo* info |
| int | codePoint (char code to create glyph from) |
| float* | xscale: relative scale to get 1.0f width back. (300 / xscale) |
| float* | yscale: relative scale to get 1.0f height back. (300 / yscale) |
| int* | newXoff: relative xoffset. |
| newYoff | relative yoffset. |
- Returns
- stbi_uc* pointer to texure data.
◆ getAdvance()
| glm::vec2 luna::vulkan::vulkanFont::getAdvance |
( |
char |
character | ) |
|
|
overridevirtual |
◆ getGlyph()
◆ getScale()
| glm::vec2 luna::vulkan::vulkanFont::getScale |
( |
char |
character | ) |
|
|
overridevirtual |
◆ writeGlyphsIntoBuffer()
| void luna::vulkan::vulkanFont::writeGlyphsIntoBuffer |
( |
| ) |
|
|
private |
◆ buffer
| std::vector<VkBuffer> luna::vulkan::vulkanFont::buffer |
|
private |
◆ height
| const int luna::vulkan::vulkanFont::height = 4800 |
|
staticprivate |
◆ imageHandle
| VkImage luna::vulkan::vulkanFont::imageHandle = VK_NULL_HANDLE |
|
private |
◆ imageViewHandle
| VkImageView luna::vulkan::vulkanFont::imageViewHandle = VK_NULL_HANDLE |
|
private |
◆ testBuffer
| VkBuffer luna::vulkan::vulkanFont::testBuffer = VK_NULL_HANDLE |
|
private |
◆ width
| const int luna::vulkan::vulkanFont::width = 4800 |
|
staticprivate |
The documentation for this class was generated from the following files:
- C:/Users/robbe/source/repos/lolrobbe2/luna/luna/src/core/vulkan/rendering/vulkanTexture.h
- C:/Users/robbe/source/repos/lolrobbe2/luna/luna/src/core/vulkan/rendering/vulkanTexture.cpp