Click here to Skip to main content
15,886,810 members

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
NewsWhy I love RSS and You Do Too Pin
Terrence Dorsey17-Mar-13 8:32
sitebuilderTerrence Dorsey17-Mar-13 8:32 
GeneralRe: Why I love RSS and You Do Too Pin
  Forogar  17-Mar-13 8:42
professional  Forogar  17-Mar-13 8:42 
NewsWhy RSS still matters Pin
Kent Sharkey14-Mar-13 11:47
staffKent Sharkey14-Mar-13 11:47 
NewsHow to build a 5$ Arduino (clone) Pin
Terrence Dorsey14-Mar-13 11:13
sitebuilderTerrence Dorsey14-Mar-13 11:13 
GeneralRe: How to build a 5$ Arduino (clone) Pin
DaveX8614-Mar-13 17:54
DaveX8614-Mar-13 17:54 
NewsSix useful JavaScript libraries for dealing with data Pin
Terrence Dorsey14-Mar-13 11:13
sitebuilderTerrence Dorsey14-Mar-13 11:13 
NewsThe problem with Windows 8 development is WinRT’s lack of capabilities Pin
Terrence Dorsey14-Mar-13 11:12
sitebuilderTerrence Dorsey14-Mar-13 11:12 
GeneralRe: The problem with Windows 8 development is WinRT’s lack of capabilities Pin
Rob Philpott15-Mar-13 7:24
Rob Philpott15-Mar-13 7:24 
I'm writing a game, and have encountered a few nasties along the way.

I started off in WinForms and C#, but that was too slow so I replaced GDI+ DeviceContext with WPFs DrawingContext. All it does is draw lots of bitmaps and I thought (probably stupidly) that'd work fine. Then, when I got Windows 8 I discovered that DrawingContext didn't exist any longer.

So, it has to be DirectX which implies having to use C++, but in fact there's an open-source interop layer called SharpDX which takes that away, so now it's C#/DirectX through SharpDX.

That, actually wasn't too hard once I got my head around how DirectX works, sadly the thing which has caused me the most difficulty is something which should be easy.

The bitmaps and config sit in loose files next to the .exe, and I load them in when the game starts. All the normal FileStream/BinaryReader stuff I would normally use for this had either gone, or was unusable (I can't remember). Instead I have to use StorageFile, StorageFolder etc. which all use the new async/await pattern.

This is supposed to make asynchronous programming 'easy', but I found it to be anything but. Indeed your async method gets turned into some sort of hideous state machine and it's very hard to understand the execution flow. That and you can't call an async method from a synchronous method at all easily.

I have a Surface, and just on this device the sound breaks up, like the machine isn't getting there in time to fill the buffers properly. I've spent ages trying to fix this or work around it but no luck so-far. I'm hoping a firmware release might fix it one day.

Still, all that said it's going pretty smoothly and I've abstracted all the horror into a single assembly so that the actual game logic is just the usual C# stuff.

Interestingly, any concerns I had about the performance of C# have gone away. About 90% of the cycles are spent in DirectX so that's just fine. But I am alarmed by the ease of reverse engineering by unlocking the WindowsApps folder and using something like Reflector. I've heard rumours that obfuscating can get you into trouble in terms of certification, but that's unverified.

I also understand that if you offer your product as a "try it free" item a simple hack can convert it into the full featured app without paying for it which is pretty poor.

A lot of effort has gone into it, so I hope it doesn't tank when it comes out. If so, that'll be my app writing days over.
Regards,
Rob Philpott.

NewsThe Filesystem Test Pin
Terrence Dorsey14-Mar-13 11:12
sitebuilderTerrence Dorsey14-Mar-13 11:12 
GeneralRe: The Filesystem Test Pin
Rob Grainger14-Mar-13 23:39
Rob Grainger14-Mar-13 23:39 
GeneralRe: The Filesystem Test Pin
Bernhard Hiller15-Mar-13 2:07
Bernhard Hiller15-Mar-13 2:07 
NewsC++11 compiler support shootout: Visual Studio, GCC, Clang, Intel Pin
Terrence Dorsey14-Mar-13 11:11
sitebuilderTerrence Dorsey14-Mar-13 11:11 
NewsIt's Flash, all over again Pin
Kent Sharkey14-Mar-13 10:26
staffKent Sharkey14-Mar-13 10:26 
GeneralRe: It's Flash, all over again Pin
db7uk14-Mar-13 10:43
db7uk14-Mar-13 10:43 
NewsThe RSS Apocalypse Pin
Terrence Dorsey14-Mar-13 10:04
sitebuilderTerrence Dorsey14-Mar-13 10:04 
QuestionRe: The RSS Apocalypse Pin
Sampath Sridhar18-Mar-13 0:26
Sampath Sridhar18-Mar-13 0:26 
AnswerRe: The RSS Apocalypse Pin
bitterskittles18-Mar-13 2:22
bitterskittles18-Mar-13 2:22 
GeneralRe: The RSS Apocalypse Pin
Sampath Sridhar18-Mar-13 17:28
Sampath Sridhar18-Mar-13 17:28 
NewsFixing Windows 8: Advice for Users and for Microsoft Pin
Terrence Dorsey14-Mar-13 10:04
sitebuilderTerrence Dorsey14-Mar-13 10:04 
GeneralRe: Fixing Windows 8: Advice for Users and for Microsoft Pin
LloydA11114-Mar-13 11:09
LloydA11114-Mar-13 11:09 
NewsSimCity mod demonstrates the possibility of some form of indefinite offline play Pin
Terrence Dorsey14-Mar-13 10:03
sitebuilderTerrence Dorsey14-Mar-13 10:03 
NewsA brief history of pi Pin
Terrence Dorsey14-Mar-13 10:03
sitebuilderTerrence Dorsey14-Mar-13 10:03 
GeneralRe: A brief history of pi Pin
Rob Grainger14-Mar-13 23:15
Rob Grainger14-Mar-13 23:15 
AnswerRe: A brief history of pi Pin
Matt T Heffron15-Mar-13 8:14
professionalMatt T Heffron15-Mar-13 8:14 
NewsWhere and When Did the Symbols “+” and “–” Originate? Pin
Terrence Dorsey14-Mar-13 10:03
sitebuilderTerrence Dorsey14-Mar-13 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.