14 #define SCALE_CALC 30.0f
15 #define SCALE_DRAW SCALE_CALC
21 s.c_str() + s.length());
26 glm::vec4 color, std::string s) {
30 ImU32 col = (
ImU32(color.r * 255)) | (
ImU32(color.g * 255) << 8) | (
ImU32(color.b * 255) << 16) |
31 (
ImU32(color.a * 255) << 24);
36 dl.
AddText(font, scale *
SCALE_DRAW, pos, col, s.c_str(), s.c_str() + s.length());
46 s.c_str() + s.length());
51 glm::vec4 color,
unsigned int maxWidth, std::string s) {
55 ImU32 col = (
ImU32(color.r * 255)) | (
ImU32(color.g * 255) << 8) | (
ImU32(color.b * 255) << 16) |
56 (
ImU32(color.a * 255) << 24);
61 dl.
AddText(font, scale *
SCALE_DRAW, pos, col, s.c_str(), s.c_str() + s.length(), maxWidth);
Default Font Implementation.
static void drawTextWrapped(unsigned int x, unsigned int y, float scale, glm::vec4 color, unsigned int maxWidth, std::string s)
IMGUI_API void PushTextureID(const ImTextureID &texture_id)
IMGUI_API void PushClipRect(const ImVec4 &clip_rect)
static void drawText(unsigned int x, unsigned int y, float scale, glm::vec4 color, std::string s)
IMGUI_API void AddText(ImFont *font, float font_size, const ImVec2 &pos, ImU32 col, const char *text_begin, const char *text_end=NULL, float wrap_width=0.0f, const ImVec2 *cpu_clip_max=NULL)
static unsigned int widthText(float scale, std::string s)
IMGUI_API ImGuiIO & GetIO()
value_type & at(size_t i)
ImFontAtlas * ContainerAtlas
static void renderImGui(ImDrawList **const draw_lists, int count)
ImVector< ImFont * > Fonts
IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char *text_begin, const char *text_end=NULL, const char **remaining=NULL) const
static unsigned int heightText(float scale, unsigned int maxWidth, std::string s)