MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_text.hpp File Reference

Vulkan SDL_ttf text renderer. More...

#include <volk/volk.h>
#include "mxvk_exception.hpp"
#include <SDL3/SDL.h>
#include <SDL3_ttf/SDL_ttf.h>
#include <cstdlib>
#include <cstring>
#include <format>
#include <iostream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  mxvk::CachedTexture
 GPU texture resources cached for a rendered text string. More...
struct  mxvk::CacheKey
 Cache key combining text content and colour. More...
struct  mxvk::CacheKeyHash
 Hash functor for CacheKey. More...
class  mxvk::Font
 Small RAII wrapper for an SDL_ttf font handle. More...
class  mxvk::VK_Text

Namespaces

namespace  mxvk
 Utilities for loading and saving PNG images.

Macros

#define VK_CHECK_RESULT(f)

Detailed Description

Vulkan SDL_ttf text renderer.

VKText rasterises text strings into SDL surfaces, uploads them as Vulkan image textures, and batches the resulting quads for submission during the render pass. Each printTextG_Solid() call adds one TextQuad to the pending queue, which is flushed by renderText().

Definition in file mxvk_text.hpp.

Macro Definition Documentation

◆ VK_CHECK_RESULT

#define VK_CHECK_RESULT ( f)
Value:
{ \
VkResult res = (f); \
if (res != VK_SUCCESS) { \
throw mxvk::Exception(std::format("Fatal : VkResult is \"{}\" in {} at line {}", static_cast<int>(res), __FILE__, __LINE__)); \
} \
}

Definition at line 28 of file mxvk_text.hpp.

28#define VK_CHECK_RESULT(f) \
29 { \
30 VkResult res = (f); \
31 if (res != VK_SUCCESS) { \
32 throw mxvk::Exception(std::format("Fatal : VkResult is \"{}\" in {} at line {}", static_cast<int>(res), __FILE__, __LINE__)); \
33 } \
34 }