Default font not drawing

#1

I cannot seem to get the default font working, ive tried to also add a font packaged with ImGui with no luck. i tried to follow the example, read documentation, and watch youtube videos with no luck either. pushing a font causes a crash and ive traced it to line 3388 || 3389 in ImGui.cpp

Im really lost, i can get a window to pop up that works, but without text. ill link my github project. Any help will be GREATLY appreciated! thanks!

ive been programming for 6 months, so sorry if im not as snappy to understand or my knowledge isnt as complete as it should be.

0 Likes

#2

Hello,

When you stumble on assertions or error, please try to provide a precise call-stack.
We can’t identify what is line 3388 in ImGui.cpp if we don’t know exactly which version of the file you are using.

As it happens those are assertions in NewFrame() and each of them has a comment explaining what you did wrong. Compare your app to the examples/ app to find out what you have missed based on the hint provided by the comment, and using file search within the examples/ folder.

0 Likes

#3

Will do, thanks! Im using release v1.69 and i think i just expected it too babysit me too much from the example. i cannot get the example code working in my renderer. it draws the window, but no text.

IM_ASSERT(g.IO.Fonts->Fonts.Size > 0
&& “Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?”);

this is the line that throws. im reading the notes in ImGui.h for GetTexDataAsAlpha8();
If its not a problem im creating from not knowing how to use it, ill post my call stack and all that.

0 Likes

#4

i am still very lost, ive tried every method to load the default font that i can find. its not null according to the check, and ill get no errors but still no text. i see there is quite a few ways the default font gets built and loaded with checks. maybe im missing something.

im not sure what you mean when you say to provide a detailed call stack. i cant seem to find help anywhere else on this, and ive looked A LOT. im about ready to give up, because its not like its very complicated to take the first step based on the example project.

0 Likes

#5

Fixed it! with a little help from others. i found out i needed to change a GL state, and disable GL_STENCIL_TEST! :slight_smile: this is wicked awesome to use.

0 Likes