-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glyphs cache only properly caches texture for first character #258
Comments
Have you tried the "hello_world" example here? https://github.com/pistondevelopers/piston-examples |
I got the same bug running your example. |
It seems that the bug appears when loading a font from included bytes. |
I tried several things, and it seems that my code was missing the line at the end of the glyphs.factory.encoder.flush(device); I have never needed this before, so I assume that requiring this flushing has something to do with a recent change to the API. Was this done automatically before? |
Ah! Yes, the flush is needed when using gfx_graphics. This is because of the caching. |
I have noticed an error that only seems to be present in newer versions of
piston_window
. This error is not present in version0.89.0
, the version I was on before updating.I have tested this code on version
0.100.0
:This opens a window that looks like this:
As you can see, only the letter
t
was properly cached. When trying other strings, it is apparent that only the first character introduced to the glyphs cache is actually cached.I have tested it with different fonts, and the same error occurs.
I looked at the
GlyphsCache
code, but I couldn't figure out why this would be happening. Am I doing something wrong, or is this a bug?The text was updated successfully, but these errors were encountered: