c99-raylib-cimgui-template icon indicating copy to clipboard operation
c99-raylib-cimgui-template copied to clipboard

Font Failed to load

Open MasonJohnHawver42 opened this issue 3 years ago • 3 comments

image

image

`// Initialize imgui igCreateContext(NULL); struct ImGuiIO *io = igGetIO();

ImGui_ImplRaylib_Init();

igStyleColorsDark(NULL);

int width = screenWidth; int height = screenHeight; unsigned char *pixels = NULL; ImFontAtlas_GetTexDataAsRGBA32(io->Fonts, &pixels, &width, &height, NULL);

Image image = LoadImageEx((Color *)pixels, width, height); Texture2D texture = LoadTextureFromImage(image); io->Fonts->TexID = (void *)&texture.id;`

The font isn't loading right or rendering right or it just isn't using the font The texture atlas for the font does load and is draw onto the screen as seen. help pls!!!

Also I'm using C++17 and the latest version of raylib (should I just use another implementation???)

[note I'll just use : https://github.com/JeffM2501/raylibExtras/ ]

MasonJohnHawver42 avatar May 26 '22 00:05 MasonJohnHawver42

Replace rlEnableTexture() with rlSetTexture(). This made the difference for me.

Lyniat avatar Jun 06 '22 12:06 Lyniat

I'm afraid that function behaviour was changed in raylib 4.0 to be aligned with OpenGL. It probably broke some samples out there...

raysan5 avatar Jun 06 '22 12:06 raysan5

I ended up using the normal imgui libary with a raylib implementation.

FIX

MasonJohnHawver42 avatar Jun 10 '22 20:06 MasonJohnHawver42