IntroductionI like making little 2D games from time to time. There are a myriad of tools to do this, but as a Systems Admin I like working as close to the computer as I can without getting bogged down in pointers. So many tools like Unity, RPGmaker, etc. are too high level (pun) for me -- I like knowing what's going on in the code -- while using the Directx/Direct2D in c++ gets too frustrating with it's micromanaging minutia, lack of generic object lists, pointer resolution, and memory management.
So it's a struggle, and it's always bugged me that C# (My favorite mid-level language) doesn't have any official API for DirectX. Someone at Mircosoft seems to have been thinking the same thing as they're working on Win2D -- a c# implementation of Direct2D, which is supposed to bring at least the 2D portions of DirectX to native Windows applications. Previously I've used third party offerings (SFML, namely) to accomplish this.
As I write this introduction I am just getting started setting it up. So what follows will be my first-impressions look at the (Alpha, Beta?) package as of version -- 0.0.22 at time of writing.
I am following the quickstart and getting set-up guides on the github site. Using my work machine (windows 8.1, vs 2015 community RC) and my home machine (win 10 RC, vs2015 community RC).
- There is no "blank app" listed under my Visual C# templates, hopefully the "Blank Solution" under Visual Studio Solutions works. Couldn't find it in the online templates either.
- Error "no projects in this solution supported by nuget" so that's fun
- Trying to add additional packages to VS install, see if that helps
- Yes that worked. From the Visual studio installer I added everything under "Windows and Web Development" and now I have the blank app as an option. It's listed as "Blank App (Universal Windows 8.1) which isn't quite the same as the guide says, but it's closer
- As always, visual studio is weird about network locations.
- Have to get a developer license for this type of app. It's apparently free, so whatever.
- Nuget works now
- Getting "Cannot Create an instance of "Canvas Control"" when following step 4 in quickstart
- Specified module cannot be found 0x8007007E
- appears to happen for all canvas modules
- Switched Processor target under Build > Configuration Manager from 'any CPU' to 'x64' this seems to have cleared up the issue (did have to compile before the warning went away)
- The cpu target thing was mentioned in the instructions, I just missed it.
- Have drawn some text and some shapes, neat
- getting into animation
- CanvasAnimatedControl is kind of neat, appears to handle the looping for you for drawing. Just have to say draw these things, then it redraws as those things change.
- trying to figure out the precise commands by adding a button to the mix
- Hurray I have a generic object list I can add/remove things from that automatically draws to the screen.
- Method of loading images is a bit wonky, but ultimately works
- Wonder if I can get this working in a non win8 style app. Just like, a wpf app or something.
- Some things I've read suggest not, but we'll see.
- yep it appears not
ConclusionSo there's that. Not really what I'm looking for since it only supports Windows apps. Still it seems nice, really straight forward and what have you. If I were looking to make a windows app it would certainly appeal.
Maybe one day Microsoft will make an official supported C# wrapper for DirectX. For now I think I'm going to try SharpDX and see how that goes.