Posts Tagged ‘3d’

You Mean I’ve Been on the Dark Side All Along?

2012/04/22 1 comment

This is how I felt earlier this week after my initial forays into OpenGL, an open standard graphics library for multiple platforms.  From the books I was reading, I had come to realise that XNA is perhaps an immature API from both age and sensibility viewpoints, particularly where one is concerned with cross-platform and backwards compatibility and DirectX was just too hard.  I was already aware of the last point from personal experience.

I quite like how OpenGL has its extension system to expand the API without breaking other peoples code.  XNA and DirectX could learn a lesson here.

The XNA team have had a history of breaking backwards compatibility for “reasons” of motivation.  There were major breaking changes between XNA 3 and XNA 4.  The future of XNA to me is uncertain.  Microsoft’s next OS Windows 8 has XNA no where to be seen. XNA can be found on Windows Phone 7 devices but they are quite rare.  There is XNA on XBOX for end-users, but it has fewer features than what a proper XBOX game has access to hardware-wise. XNA was not the first Microsoft managed DirectX wrapper.  Before XNA there was MDX and sadly it went the way of the Dodo bird.

Just a few lines is all it takes to display a 3D window

OpenGL is reportedly easy to learn and thus far I agree with what I have been told.  Just a few lines is all it takes to display a 3D window.  It’s also good to know that no bloatware, no mammoth class libraries, no over-the-top OO-style programming – just pure, nice and clean c-style methods.   Contrast this with DirectX – now I would like to think I know something when it comes to COM, but trying to learn DirectX is quite challenging.   DirectX did come out later with c++ helper classes but they were perhaps rather limited and let’s face it – too late!

XNA is a lot easier than DirectX but its way harder than OpenGL, however XNA is slightly bloaty compared to OpenGL.  Plus unlike XNA, OpenGL doesn’t have ridiculous legal restrictions on what you can do or how you distribute your application.   Want to give your buddy your game to try out?  He may need Visual Studio 2010; XNA Game Studio installed; and know how to compile your program.   Not fun.

…we still have point sprites on OpenGL using the same modern-day video card!

The worst bit about learning XNA, was how unprofessional some of the key representatives and tutors were on certain forums and blogs.  No, these were not fan forums.  Forum manners were atrocious; people with perceived ulterior motives; and some cases of propaganda.  One was to do with the elimination of point sprites from the API, another over not to use the FBX file format and the bizarre recommendation for people not to use sky domes.  Funny, we still have point sprites on Windows via OpenGL using the same modern-day video card!   Even iPads can use point sprites via OpenGL ES.  Sure, point sprites may be old hat but we were lead to believe that modern hardware doesn’t support it when the truth is is that latter DirectX doesn’t.

The point is, if my legacy app wants to use some ancient deprecated feature, the API should damn well let it have it, even if it means it runs like a pig.  This is why OpenGL is so much better.  OpenGL is kinder to you – it gives you the opportunity to run your legacy app whilst allowing you to gradually upgrade to newer discipline.

You were told to do things a certain way in XNA either with no explanation, or if one was given, was perhaps a half-truth in hind-sight.  I was reminded of how I felt when I first heard of OpenGL back in the days of Windows NT 4 and basically dismissed OpenGL most likely due to at the time being influenced by others in the know.  Back then, I suspect I didn’t hear both sides of the story, like the point spites half-truth.

Now I don’t profess to be an expert in XNA, let alone DirectX, but my experiences in both of these has made me come to the realisation that I have more important things to worry about – what my application is about and how the tools or APIs can help me.

Hello OpenGL, so nice to be in the light with you!

Categories: Development Tags: , , ,