which api

Started by
11 comments, last by Arelius 16 years, 5 months ago
i still havnt reached the graphical programming of my game yet. I start asking myself directx or opengl. Since my goal is to join the industry one day, what api is mostly used in the pc gaming industry . I read that both are the same and to choose one is to flip a coin. There must be some minor differences.
Advertisement
There are actually quite a few differences between the two API's though most are a matter of preference, a few are relevant to functionality. So, other then platform compatability, what can be done in one can generally be done in the other.

The key thing about Direct3D is it is developed by Microsoft, for Microsoft systems, the biggest impact of this, is that Direct3D will only run on Windows/XBox. Microsoft also seems to target the game developer who needs hardware acceleration, so DirectX generally mirrors the hardware much better, not leaving around tons of slow functions you shouldn't be using anyways. Additionally, considering that Microsoft has a much quicker release scheldule for new versions, and a COM based version scheme, that allows Microsoft to release full updates that remove depricated functions, and actually refactor the system, all without breaking older code. In addition, Direct3D also uses an object oriented approach as opposed to GL's C State based system, even though it's generally a matter of opinion. the prior is generally accepted as easier to manage. All this together makes Direct3D generally accepted as the better API.

OpenGL's main strength lies in the fact that there is a working implementation on just about any system you could want it on (other then XBox), and getting a triangle rendering may look easier. but all in all, the difference is very minimal. Bigger problems lie in the fact that OpenGL is still backwards compatable to IrixGL some 20 years ago. That leaves us with alot of bloat and legacy that we need to wade through. Additionally the entire extension system leaves much to be desired, with often 2 or more implementations of the same functionality for differen't hardware. and considering the slower release scheldule that becomes rather common. There is high hopes that most of this will be fixed with OpenGL 3.0 in early 2008, which will remove alot of the old deprecated functionality along with removing the fixed function pipeline (good riddance) and modify the entire thing to stop managing internal state which should simplify more complicated systems and also give us a preformance boost. But in all, if you have any sort of want to write an application that has a chance of running on Mac, Linux, PS3, or Wii you'll have little choice but to use OpenGL.

Indy
The main difference, from my knowledge, comes down to 2 things:

1. Do you want your game to be multi-platfrom?
2. What you already know?

I have used both OpenGL and DirectX and personally I find that OpenGL fits better with my programming style, but I certainly wouldn't say that one is better than the other.

Another option is to use a wrapper that allows either OpenGL or DirectX to be utilised without any additional programming. You wouldn't need to know how to implement the intricate detials of either API but of course, you would have to learn how to use the wrapper.

A very good one is Ogre3D, it has a huge community and is very mature in it's development. Open source and has a good licence.
You can hardly refer to Ogre3D as a "wrapper" it is rather much an entire rendering framework/engine. It manages the scene, has higher level concepts such as camera's already handles multipass rendering, and shadows. Now sure I hear it is rather good at all of that, but using Ogre3D is nothing like either Direct3D or OpenGL.

Indy
To be honest I didn't know what to call it. I realise that it is much more than a wrapper but it is not a full game engine either. It's primary purpose is to handle the graphics side of your game.

The thing is, before you develop your game you need to decide which API you are going to use. I was merely pointing out that there are other options apart from directly implementing it in OpenGL or DirectX.
i already have ogre but the thing i was asking myself is that is it better to learn an api, then use a wrapper or the other way around. right now im not planning to make an engine, just creating a game but i will have to develop sound,text and physics engines if i want to use ogre so im confused.
zarfius, It is certinally good for one to know all their options (even of full game engines) I just thought it be made clear that Ogre was not any simple wrapper that would put it even remotely in the same class as DX/GL.

blackplasma, That is just a choice that depends on you're situation, and certinally learning DX/GL will teach you alot more about the internal workings of the hardware/rendering pipeline, but only you can classify that as better or not. On the same note though, you're going to have to develop sound, text(actually, I think Ogre has text functionality), and physics, just as much if you use DX/GL as you would with Ogre.
Quote:Original post by blackplasma
i still havnt reached the graphical programming of my game yet.
I start asking myself directx or opengl.
Since my goal is to join the industry one day, what api is mostly used in the pc gaming industry . I read that both are the same and to choose one is to flip a coin. There must be some minor differences.

Unfortunately, it appears that OpenGL is being taken over by Direct3D in the gaming industry. All the recent big-budget games are Direct3D, with few exceptions. From Unreal Tournament 3 to Crysis to Half Life 2, they're all DirectX based. The only major OpenGL game/engine is the Doom 3 engine and the games based on it.

As far as functionality goes, they were pretty much the same until Direct3D10. OpenGL doesn't really yet have an equivalent to Direct3D10 - from what I hear the support for Direct3D10 features in OpenGL isn't great. But I doubt you'll be needing the advanced features of D3D10 anyway, so it may not be a concern.
NextWar: The Quest for Earth available now for Windows Phone 7.
is designing an engine as bad as it sounds,im thinking of taking the easy way and use dark basic ( the shame )
Yes, generally. Designing a fully featured, useful, and decently-performing engine is a massive amount of work. It's certainly not something to be done as an early project unless you want to end up discouraged. If you just want to create games, then DarkBasic is definitely an option. However, if you want to get into the industry as you said, you'll need to show skill with C++. That doesn't mean you have to write OpenGL or DirectX though - probably the majority of games these days use 3rd party rendering engines.

This topic is closed to new replies.

Advertisement