1
\$\begingroup\$

Since ImGui builds on top of stb_truetype for its font rendering, I thought it could be nicer to use its already built font-processing capabilities (ImGui::GetIO().Fonts), and render with those, instead of using stb_truetype directly.

However, I've been having trouble figuring out how to do this, specifically how to get quad position/texture coordinates for a given string to use with the preloaded texture at ImGui::GetIO().Fonts->TexID.

I'm not looking to draw buttons/text inside ImGui windows, all I want to do is to use ImGui to build vertex data for a given string so that I can render it anywhere.

\$\endgroup\$
1
\$\begingroup\$

From the GitHub issue you opened and the ImgUi FAQ:

Create a dummy window with NoTitleBar|NoResize|NoMove|NoScrollbar|NoSavedSettings|NoInputs, then you can retrieve the ImDrawList* via GetWindowDrawList() and draw to it in any way you like.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.