nanoMMO
0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
icon.h
Go to the documentation of this file.
1
#ifndef NANOMMO_CLIENT_ICON_H_
2
#define NANOMMO_CLIENT_ICON_H_
3
4
#include <cstdint>
5
#include <string>
6
7
namespace
nanommo
{
8
9
/// A Font Awesome icon, by its code point, as text for ImGui. The icons are in
10
/// Unicode's private use area, between U+E000 and U+F8FF, which UTF-8 writes
11
/// in three bytes.
12
inline
std::string
Icon
(uint32_t code) {
13
return
{
static_cast<
char
>
(0xE0 | (code >> 12)),
14
static_cast<
char
>
(0x80 | ((code >> 6) & 0x3F)),
15
static_cast<
char
>
(0x80 | (code & 0x3F))};
16
}
17
18
}
// namespace nanommo
19
20
#endif
// NANOMMO_CLIENT_ICON_H_
nanommo
Definition
chat.cc:9
nanommo::Icon
std::string Icon(uint32_t code)
Definition
icon.h:12
client
icon.h
Generated by
1.15.0