Some ConsoleWrapper changes
Have spent a bit of time working on ConsoleWrapper today:
- Fixed a major memory leak that was causing memory usage to climb indefinitely, until it caused ConsoleWrapper to crash. This was obviously a Bad Thing™. Memory usage now sits at a comfortable ~24MB on startup, and doesn’t increase significantly with use.
- Added a new built-in command (i.e. that doesn’t utilise CMD) for viewing images inline within ConsoleWrapper. Usage is VIEW IMAGENAME, where IMAGENAME is a valid image path. If the image is too large, it will automatically be resized to be visible within ConsoleWrapper. Here’s a screenshot with a couple of images displaying inline. Screenshot taken during animating from the top of the stream to the bottom, which is the cause of the funny-looking angle, and edge jaggies:
Click through to see full size. As an aside, looking at that less-than-savoury edge antialiasing, I’m kind of tempted to implement some AA. An easier way would be to just put a black border into the texture though. Maybe something for next update.
Also evident in this screenshot, is the new feature whereby strings are rendered as individual letters, each letter being a sprite. Unfortunately, this means kerning is lost, and the string renders with significant whitespace between each character. This is something I am working to fix, but seems to be related to .NET’s Graphics library overestimating font sizes when performing a MeasureString operation.
Using sprites has also seemed to result in sub-par performance (i.e. lower performance than the old method of using pre-rendered full string textures), and I’m not entirely sure why – it was meant to increase performance, if anything. This is especially noticeable when rendering large swathes of text, such as from a DIR command on a large directory. Definitely something else to work on improving and optimising.
Note that I haven’t put out a compiled release of this yet, but the latest source is available as always on SourceForge.
Update 27th April: Here is a video showing the latest changes (including a fix to kerning problems):
This entry was posted on Monday, April 26th, 2010 at 2:57 pm and is filed under Console Wrapper. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Tom is a 25 year-old software engineer currently based in Seattle, Washington. This is his personal blog, and views do not reflect those of his employer. Click
April 28th, 2010 at 11:26 am
Hey man, I remember you working on this back in the day, good to see it’s still coming along. Looking good
April 28th, 2010 at 12:53 pm
Cheers Brad! Yeah, it’s one of those projects I dust off every 6 months or so, heh.