Direct X vs OpenGL

GSAV55

New Member
I tried searching and didn't see any threads on this yet. I'm pretty good with C, and am learning Processing. I am interested in writing games. I dont know Direct X or OpenGL, so I need to learn at least one of them. I am wondering what you think would be better to learn initially and why.

Thanks.
 

GSAV55

New Member
Thanks, thats a pretty decent read.
Does anyone have any idea if one is easier to learn and work with than the other, compatibility aside? Right now I just want to start learning and working with one to have some fun and try to make some games. Really more of a learning experience than anything else.
 

tlarkin

VIP Member
You'd be better off talking to a game developer. Open GL works on everything though. Windows, Mac OS, Unix, Linux, and consoles.
 

sometechieguy

New Member
Easier is a relative term in this case depending on what you're trying to do. But generally speaking (from what little I know in this area) DirectX will be "easier" to just 'make a game'. OpenGL is probably more flexible but at a cost of a slightly higher learning curve. That said there will be tons of resources at OpenGL.org - that and you don't have to necessarily be starting from scratch in raw opengl. Look at open source game engines like Nel (open source RPG engine from a commercial European MMORPG) or the Ogre3D rendering engine, again in opengl/c++. Crystalspace 3D if it's still around... Irrlicht 3D, another free game engine OpenGl/C++ project.

Lionhead studios (game company) also has a great forum where you could ask more knowledgeable people about this.

Again, DirectX, probably will be 'slightly' simpler. OpenGL will arguably be more flexible in the long term (DirectX probably does everything OpenGL does but OpenGL lets you do it differently based on your needs - that extra problem solving can slow you down some days, or be a god send when you're trying something a little odd) at a slightly more difficult learning curve.

Also if you go with a game engine.... you use the game engine's pre-built function calls and don't initially need to know OpenGL... although an understanding of it and it's functions will make development life easier.

When you want to start customizing effects in that game engine that might be where you start overloading functions or making your own copies of functions and modify their OpenGL calls.

Good luck. Games are fun to build but a lot of work. It takes a lot of dedication and patience, but if you want to do it don't let anything stop you.
 

kobaj

VIP Member
Hey!

I've programed both DirectX and OpenGL (C# mind you), and what sometechieguy says is very true.

DirectX is much simpler to just 'jump in', you can have a game made in a few days (or hours, whatever your programing skill is). But its slightly less powerful, and more restricted (ie, can only do windows/xbox). One slight problem with DirectX is how everything didn't really connect together (like DirectInput hasn't been updated in years and you're better off writing your own hook).

OpenGL I felt completely lost in at first, but found that thats because a lot of drawn out functions of DirectX are just single commands in OpenGL. OpenGL is much more powerful, and runs on practically anything (windows, linux, ps3, etc). One thing I rather liked about OpenGL was the fact that practically everything is contained in one wrapper (well, for C# at least, like with OpenTK).

(And to nullify a flame war, by "powerful" I mean DX 10 is JUST now coming out with functions that GL has had for years).

I'll mention as well, if you do choose OpenGL, there are a lot more tool kits (like, OpenTK the OpenGL Took Kit :p), making it easier for fresh programmers to get started.

But, once you've chosen one, and both have a sufficient amount of help and guides out there, but try not to mix them. IE, if you choose DirectX, stick with DirectX guides. One uses right handed matrices, the other left; HLSL functions dont match GLSL (mul in particular), and a few other things don't line up for beginners.

Whatever you pick, you can't really go wrong. What helped me out in the end, I started making the exact same game in both DX and GL and found I understood DirectX a lot more (all those years of messing with XNA probably biased me, but hey). And I went with DX, best of luck with your in your decision (and I hope I can help you if need be).

EDIT:

I noticed you said you just wanted to start programing and making games today. If I might suggest, you check out XNA. Its a toolkit made for DirectX that really helps beginners. It handles all the device catching and really lets you just start making a game. Yes, its C#, but the brother of C makes it super simple and fast to learn. (P.S. Riemers tutorials are amazing).
 
Last edited:

sometechieguy

New Member
Great info kobaj. I stopped my game research in 2004 and haven't really picked it up again since. Went overseas for a year and didn't remember to get back into it, lol. I've been learning flash a bit lately and hoping PS3 and XBox will put a flash plugin in their browser. Small scale flash games suddenly become widely portable - multiple OS's, phones (depending on memory requirements and size), and consoles? Very nice..

But that reminds me of another good point about the DirectX route. Microsoft provides an Xbox developer SDK (once you get that far, don't get in that deep to start with) where you can develop in C# and publish your games on a (rather saturated) store/freeware site accessible via xbox.

C# performance wise is not bad. Last I checked it was about halfway between the performance of Java and C++. It may have gotten a little faster over the years.

If you also just want to make "simple" games to start with to learn about logic flow, event based design, use of sprites, etc.. try Gamemaker. There's a free and a pro version ($40 last I checked). What you make with it will be simple but it's certainly "neat".
 

kobaj

VIP Member
I guess its my fault for not putting this information in, but hey...

Microsoft's XNA lets you build and compile games for PC, Zune, and Xbox 360. I've never heard of having to use any form of SDK with XNA, its just a few extra lines of code stating "deploy on Xbox" or "deploy on pc" etc depending on the platform you wish to develop.

And for the record, XNA, the build process, etc, its all free for all PC, Zune, and Xbox. However, Xbox game developers, if you want to sell the game/let other users play it/have it downloadable over Xbox live...Then you have to become a "Premium Member" which is around 100$. Frankly, I just stick with building Window games (which are free).

The Creators Club is an excellent resource for more info on XNA.
 

tlarkin

VIP Member
Most SDKs for gaming cost money, and that is why Nintendo got a lot of praise when the Wii first came out. Their SDK was right near $1,000 outright, which is one of the cheapest SDKs for console gaming.

I know for iPhone developers they gotta pay like $80 a year for a subscription to the SDK.

Now a lot of times a developer will release a SDK for a specific product. So if you buy say application X, it may also have a SDK with it so you can develop your own mods/apps for that application but it won't allow you to develop apps that can be ran with out the parent application.

Developers need to get paid, so this is why things cost money. Open GL however, to my knowledge is still an open standard. Which is why a lot of game developers just pay the license fee to license an existing game engine with a custom built set of APIs. That is also why certain companies like id software for example, make a crap ton of money off the Doom and Quake Engines. Now id Software is coming out with the Rage Engine and that looks promising. Many games were built off the UT engine as well as the Source Engine from Valve.

So, really you could feasibly never once in your entire life actually create a video game, but rather code a bad ass game engine and then sell your engine to game developers who use your tools you created to create a game.
 

kobaj

VIP Member
Most SDKs for gaming cost money, and that is why Nintendo got a lot of praise when the Wii first came out. Their SDK was right near $1,000 outright, which is one of the cheapest SDKs for console gaming.

*snip*

You meant SDK for a prebuilt engine! I was thinking you were saying SDK for a wrapper. "What is he talking about" just kept going through my head.

I think it should be warranted, some people around here might be getting confused.

An SDK, or software development kit, is a library of prebuilt code that uses an engine built ontop of an API. Long story short, it allows you to use a very complicated engine, easily and quickly with very little code on your part.

An API, which is DirectX or OpenGL, is a compiled bit of code that handles interaction between the user/engine and hardware. There are no SDKs for API's or Wrappers (Ok, there ARE, but they're not assembled like a typical SDK).

Wrappers are just simplified version of DirectX or OpenGL, often a little slower, but more powerful and easier to use. Beginners love wrappers. Examples include Microsofts XNA or OpenTK.

In which case, yeah, if the OP didn't want to build his own engine and just used an SDK it could get very expensive very quickly depending on which engine he chose. (Well...Valve's is free, but hey.)

But I assumed since the OP was looking for information on API's he wanted to make his own engine, thus, freedom!

EDIT:

Clear up more confusion, using an API or Wrapper is (usually) 100% free. Writing your own engine is 100% free. As tlarkin pointed out, using an SDK/pre existing engine can get expensive. I said earlier usually free because there are exceptions for specialty made API's (such as iPhones) or using a free API on special hardware (XNA and Xbox).
 
Last edited:
Top