Piston-Tutorials icon indicating copy to clipboard operation
Piston-Tutorials copied to clipboard

Sudoku: GlyphCache error

Open observant2 opened this issue 8 years ago • 3 comments

In the tutorial it says to import opengl_graphics::glyph_cache::GlyphCache. This doesn't seem to exist anymore. What exists instead is opengl_graphics::GlyphCache.

Also the constructor of GlyphCache takes three arguments instead of two. There is a factory needed.

How can I compile the code? I cannot find anything about the factory. Also I followed the tutorial step by step.

Maybe problems like these can be solved in the future with adding versions to the dependencies. As piston seems to change very fast, specific library versions can make sure that the tutorial still works, even when newer versions of piston or any dependency came out. :-)

PS: I found opengl_graphics::graphics::glyph_cache::rusttype::GlyphCache, but it seems to be the same struct as opengl_graphics::GlyphCache.

observant2 avatar Oct 08 '17 17:10 observant2

Okay, piston2d-opengl_graphics 0.46.0 seems to be the last version that still had opengl_graphics::glyph_cache::GlyphCache. There is no combination of dependencies that could run the last Sudoku chapter, where the font is being added. Going through the versions it looked like every week new breaking changes occur.

observant2 avatar Oct 08 '17 19:10 observant2

It seems that this was fixed in adc06df9c895cb29f44d3039cb70186c59769e76.

Stigjb avatar Nov 20 '18 20:11 Stigjb

With the latest version of piston2d-opengl_graphics (0.70.0), the app panics when running cargo run. This is the error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnrecognizedFormat', src/libcore/result.rs:1187:5

DerekCrosson avatar Nov 25 '19 03:11 DerekCrosson