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::CacheKeyHash Struct Reference

Hash functor for CacheKey. More...

#include <mxvk/include/mxvk/mxvk_text.hpp>

Public Member Functions

size_t operator() (const CacheKey &k) const

Detailed Description

Hash functor for CacheKey.

Definition at line 92 of file mxvk_text.hpp.

Member Function Documentation

◆ operator()()

size_t mxvk::CacheKeyHash::operator() ( const CacheKey & k) const
inline

Definition at line 93 of file mxvk_text.hpp.

93 {
94 size_t h = std::hash<std::string>{}(k.text);
95 h ^= std::hash<TTF_Font *>{}(k.font) + 0x9e3779b9 + (h << 6) + (h >> 2);
96 h ^= std::hash<uint8_t>{}(k.r) + 0x9e3779b9 + (h << 6) + (h >> 2);
97 h ^= std::hash<uint8_t>{}(k.g) + 0x9e3779b9 + (h << 6) + (h >> 2);
98 h ^= std::hash<uint8_t>{}(k.b) + 0x9e3779b9 + (h << 6) + (h >> 2);
99 h ^= std::hash<uint8_t>{}(k.a) + 0x9e3779b9 + (h << 6) + (h >> 2);
100 return h;
101 }

The documentation for this struct was generated from the following file: