Archive for December, 2014

Cityscape 2 – The Rebirth

Friday, December 12th, 2014

Pretty sure no-one is reading this by now, but…

Many years ago, started a project documenting my implementation of a night-time cityscape, “inspired” by another project that did more-or-less exactly the same. The other posts in the series are in the same category as this post, if you fancy reading them.

The original project was implemented in C# using XNA – a great set of libraries that simplified working with DirectX considerably. Of course, Microsoft being Microsoft, they lost interest in XNA and it’s basically defunct now (last I checked it was part of the Phone SDK, but I don’t think it’s under active development any more) – the upshot being that the original project is now tricky-to-impossible to get building.

So, as part of down-tools week at work, I’ve started updating it – this time round I’m using SharpDX, a C#/.NET wrapper around DirectX. It’s basically a thin layer on top of DirectX, offering none of the convenience tools of XNA*, but I figured how bad could it be? I used to write DirectX 8 code in C++… Anyway, I’ve not been blogging this one so much, but a couple of days in and I’ve got buildings, fogging and – hopefully – a slightly cleaner codebase than last time.

Screenshot of development as at 12/12/14

You can grab the code from github – it should build in Visual Studio 2013 Community Edition – it requires DirectX 11, so you’ll need an up-to-date Windows 7, or Windows 8/8.1. For Windows 8.1, you might also need to install the DirectX 11.0 DLLs (the web installer will do that) as it only comes with 11.2 by default, and SharpDX is built against 11.0.

* actually, not entirely true, it turns out, but the way I’m using it precludes use of all the toolkit stuff that basically re-implements XNA