Posts tagged: C#
Building Content: Parameter Packs and their C# Code Generators 04 Sep 2025
In an earlier post in this series I worte about content identity being tied to the parameters used to build that content. This means that the parameter packs which drive builders are one of the major load-bearing elements of the overall design. In this post I'll describe the C# compiler plugin which makes their implementation both easier and much more reliably correct.
Read more...This Website: Optimizing Resource Inclusion 02 Sep 2025
One of the perks of making your own stuff is that some days you get to make it do neat things. Yesterday was such a day. I've long been annoyed at having every page linking in every possible script (highlight.js, MathJax, etc) just in case there might be content on that page that needs it. But now that I'm in full control of the site's generator, it was easy to just fix it.
Read more...This Website: The Generator 31 Aug 2025
All of the code I'm going to discuss here is available on GitHub. Links to specific bits of code will point at what is currently the HEAD
commit - things will naturally move and change as time passes.
Building Content: Scripting With C# 10 Aug 2025
A few weeks ago I wrote about my toy content builder. Today, I'm writing a little bit more about it.
Read more...Introducing HenchLua 04 Sep 2013
This is the first of a series of posts on the subject of HenchLua. HenchLua is an implementation of the Lua VM in C#. It's targeted at projects running in otherwise limited .NET contexts, such as web-based Unity games (the Unity plugin, I believe, requires pure verifiable CIL), mobile apps (which are memory-limited) and must meet the limitations of Mono's full AOT compiler, or apps that run on the .NET Compact Framework (whose garbage collector has some serious performance issues, as anyone who's written an XNA game targeted at the Xbox can attest).
Read more...Simple Flip Book Animation in WPF 13 Sep 2012
WPF makes it easy to animate numbers, colors, sizes, and a host of other properties. Unfortunately, it isn't easy to animate an ImageSource
property, which is what we're usually looking for when implementing a flip book animation. The closest we get out of the box is ObjectAnimationUsingKeyFrames, which works, but it's very tedious to set up all of the individual key frame times.
Working With Win32 Resources in .NET 09 Aug 2012
Most native applications make extensive use of Win32 resources. While the .NET Framework provides a far more useful resource API, it's sometimes necessary to access the old style Win32 resources. Fortunately, this isn't very difficult.
Read more...Extracting Icons from PE Files 09 Aug 2012
There are times when you need an icon file, but all you have is an icon resource embedded in a PE (executable) file. Getting at these is a little tricky, since icon files aren't stored as a simple blob in the PE file. In fact, they're split up into a number of different entries. Fortunately, it isn't very hard to combine these entries into an ICO-format data blob which you can then save to file or pass to an API that expects it.
Read more...Using Win32 Icons in WPF 09 Aug 2012
Using custom icons can be a little tricky in WPF. It's simple enough if you want to use your application's main icon or an icon file that you can refer to using a pack URI - so long as you do that, everything just works.
Read more...Windowed Fullscreen 29 Apr 2012
Windowed (fake) fullscreen is probably my favorite graphics option ever when it comes to PC games. It lets me have my nice fullscreen game, but doesn't lock me out of using my other monitor, and any programs running behind the game are an instant ALT+TAB away. Games that can go from fully windowed to fake-fullscreened in an instant are also super cool, and not all that difficult to write. So how does one implement such a thing?
Read more...Visual C#: Phantom Breakpoints 22 Apr 2012
So I've got a large solution with a lot of projects (mostly build tools) and every now and then I would get suspicious phantom breakpoints, meaning that the debugger would break where no breakpoint had been placed. This would usually happen after closing and reopening the project, and it only ever seemed to afflict the executables in my solution - never the libraries.
Read more...