Chris Whitman
|
|
« on: January 29, 2009, 07:21:44 AM » |
|
Has anyone else seen this post on the Braid blog? It discusses Microsoft's new 2D API, which is such an unusable mess than Jeff and Casey (of the Jeff and Casey show) spend a good half an hour pretty much yelling themselves hoarse about it. And frankly, I do not blame them. The first excerpt of the example is: _COM_SMARTPTR_TYPEDEF(ID2D1Factory, __uuidof(ID2D1Factory)); _COM_SMARTPTR_TYPEDEF(ID2D1HwndRenderTarget, __uuidof(ID2D1HwndRenderTarget)); _COM_SMARTPTR_TYPEDEF(ID2D1SolidColorBrush, __uuidof(ID2D1SolidColorBrush)); _COM_SMARTPTR_TYPEDEF(ID2D1SolidColorBrush, __uuidof(ID2D1SolidColorBrush));
Which is I guess using macros to create types for smart pointers based on Microsoft's completely unreadable coding standards. Maybe they could have used templates, but then they would risk the danger that their code might be legible. Did I mention that after creating these smart pointers, they have to release them manually because every time the display target changes (i.e., by the user hitting alt-tab) the device automagically frees all your resources without telling you (just like Direct3D used to do in the bad old days, if you'll recall). Considering the only reason for having smart pointers is so they are released automagically (just like if C++ had real garbage collection), why do you need to make smart pointers for things you are just going to have to release and reallocate manually anyway? You just know some middle manager somewhere spent like six months writing a code style document demanding that smart pointers be used all the time even when they clearly make no sense. It seriously only gets worse from there. The entire thing is an unreadable mess of COM and Hungarian notation which has been out of fashion for I don't know how many years. I can't see any reason besides comic effect to name all your variables "mlpsz_cfGarbage" unless Microsoft is for some reason relying on a compiler that cannot do its own type checking. The thing is... just a nightmare. Listening to the podcast actually made me angry about it, and then I went to sleep, and then I woke up and I'm still as angry and bewildered about it as I was last night. Now I am sharing it with all of you so you can also be angry and bewildered, because misery loves company.
|
|
|
Logged
|
Formerly "I Like Cake."
|
|
|
Chris Whitman
|
|
« Reply #1 on: January 29, 2009, 07:26:30 AM » |
|
In fact, I guess that's mostly complaining about the sample code provided, but... seriously, the API is even worse.
In addition to the mess of COM objects, randomly losing resources and all kinds of ridiculous retained-mode bullshit (seriously, why are we still creating brushes?), there is the fact that it doesn't even appear to support a lot of basic stuff that even the Windows GDI already supports. They mention in the podcast that the text API cannot even do proper kerning.
|
|
|
Logged
|
Formerly "I Like Cake."
|
|
|
increpare
Guest
|
|
« Reply #2 on: January 29, 2009, 07:52:37 AM » |
|
Yeah, I read the post.
Looks like a big step down from the noble DirectDraw...
Anyone here ever use WinG? I wonder if it was nice...
|
|
|
Logged
|
|
|
|
bateleur
|
|
« Reply #3 on: January 29, 2009, 02:47:54 PM » |
|
The entire thing is an unreadable mess of COM and Hungarian notation which has been out of fashion for I don't know how many years. Yup. Further to which: * Non-portable anything is out of fashion. Ten years from now anything which isn't doing what Flash is doing and running cross-platform on at least Mac/Win/Linux had better have an incredibly good excuse or nobody's going to care. * When Tcl/Tk first became popular (yes, I'm that old) its key good idea amongst the various bad ones was the principle that it should be simple to do simple things. So if you want a window you write "window" and that's all (if you have more specific or complex requirements then you choose to add that complexity). It's been well over a decade and this critical idea still seems to somehow not have reached API creators. I shall add Direct2D to my list of things never to use unless someone's paying me a lot of $$$ to do so. No, more $$$ than that. Seriously, life is too short.
|
|
|
Logged
|
|
|
|
Ivan
Owl Country
Level 10
alright, let's see what we can see
|
|
« Reply #4 on: January 29, 2009, 03:07:26 PM » |
|
Microsoft IS fucking insane. I cannot fathom the thought process that leads to most of their design decisions. It's just completely idiotic. And completely unhelpful.
I just wrote a little IDE in Cocoa that took me about one night to have a full document-based app with code completion, basic syntax highlighting and preference panel. It basically wrote itself half the time with their amazing tools. I have to port it to Windows now and i know it will take me weeks to duplicate the same functionality in shitty win32 API.
|
|
|
Logged
|
|
|
|
Crackerblocks
|
|
« Reply #5 on: January 29, 2009, 04:24:58 PM » |
|
:D Those podcasts after the link are a riot. Truely a comedy of errors.
Fortunately, we have alternatives. I get the feeling that maybe we're not the target audience of the API, even though Dircet2D is a gamey sounding name.
|
|
|
Logged
|
|
|
|
David Pittman
|
|
« Reply #6 on: January 29, 2009, 05:00:46 PM » |
|
Fortunately, we have alternatives. I get the feeling that maybe we're not the target audience of the API, even though Dircet2D is a gamey sounding name.
I get the impression it's designed for people who would write their own game engines from scratch, rather than people who want a quick and easy way to get an app running; but who would actually do that for a 2D game? And anyone who would and could do that could already just implement a 2D engine with D3D, so why? I mean, I use D3D. I don't mind the verbosity of Windows' APIs (although I also never take code verbatim from their terrible, terrible samples). I guess I'm going against the indie developer grain here, but I don't even really care about making cross-platform games, because I make games for fun, not money, and if you don't have a Windows box, that's a choice you made knowing it would limit you. But I can't understand this. As far as I can tell, it's an API no one was asking for. It's a solution without a problem. Or perhaps it's a very misguided solution to a very misunderstood problem. In any case, I don't see there being many adopters. And it's as good a reason as any to use this little guy:
|
|
|
Logged
|
|
|
|
bateleur
|
|
« Reply #7 on: January 30, 2009, 02:35:08 AM » |
|
I make games for fun, not money Which is great! But the reason I like cross-platform is because that way when I say "Hey, I made a game!" my friends can then download and play it. If I write for Windows, half of them won't get to play, which sucks.
|
|
|
Logged
|
|
|
|
Gold Cray
|
|
« Reply #8 on: January 30, 2009, 08:05:53 AM » |
|
I make games for fun, not money Which is great! But the reason I like cross-platform is because that way when I say "Hey, I made a game!" my friends can then download and play it. If I write for Windows, half of them won't get to play, which sucks. Also, just about everything you need for games can be done just as easily with cross-platform libraries, so depending on the game, it's not that much more work (it is if you're using fmodex and not VC++).
|
|
|
Logged
|
|
|
|
increpare
Guest
|
|
« Reply #9 on: January 30, 2009, 08:15:26 AM » |
|
(it is if you're using fmodex and not VC++).
eh? I've never had any bad cross-platform experiences with fmodex
|
|
|
Logged
|
|
|
|
Chris Whitman
|
|
« Reply #10 on: January 30, 2009, 09:45:41 AM » |
|
It took me about an hour to port the code base of the application I am working on over to my PC, initially. If I switch up some APIs or whatever (which I've had to do a couple of times with sound and text and such), I have to factor in a little extra time to build PC versions, but generally now that my project is all set up and such, I can just drop the source on to my other computer and it just works.
So awesome.
|
|
|
Logged
|
Formerly "I Like Cake."
|
|
|
Gold Cray
|
|
« Reply #11 on: January 30, 2009, 10:13:59 AM » |
|
(it is if you're using fmodex and not VC++).
eh? I've never had any bad cross-platform experiences with fmodex The C++ version for Windows only works with VC++, so if you're not using VC++, you end up either translating to the C version or (and I really should do this) writing your own classes so you actually just have to put in another include. It's not so bad now, but when I first tried to compile a game on Windows, it took me a while to figure out why it wasn't working.
|
|
|
Logged
|
|
|
|
increpare
Guest
|
|
« Reply #12 on: January 30, 2009, 10:16:08 AM » |
|
ah okay; I've just used the C bindings myself
|
|
|
Logged
|
|
|
|
Glaiel-Gamer
Guest
|
|
« Reply #13 on: January 30, 2009, 10:28:54 AM » |
|
anything wrong with just sticking to openGL?
|
|
|
Logged
|
|
|
|
Chris Whitman
|
|
« Reply #14 on: January 30, 2009, 11:08:41 AM » |
|
Fortunately, no.
OpenGL is still awesome.
|
|
|
Logged
|
Formerly "I Like Cake."
|
|
|
|