Friday, March 2, 2018

Dangerous Tangents

So.. I wasted an inordinate amount of time trying to add an animation capture feature to show the path-finding success.  To briefly incapsulate:

You can use the WIC Library via it's SharpDX wrapper to capture output, but only after you had quite the hand-off of devices, from your Direct3D device, to a DXGI device, to finally a Direct2D device.  Only once I got there did I realize that WIC doesn't fully implement the GIF standard, meaning you can save a bunch of frames to the GIF, but they won't be animated.

Anyway, long story short, ScreenToGif is free and works great.  It pretty much did exactly what I wanted:


...which is show off the path-find movement.  It also shows off that I probably have some implementation problems that you can see in the GIF, with wonky colors in some frames.  That's likely because the thread timer for animation isn't in any way synced with rendering thread. 

I also got font loading to work, which took me down an interesting path regarding font licenses.  Fortunately, Consolas, which is used for all the tiles, is bundled with Windows, and Neurpol, the title font, is free to use.