direct x or openGL

Pages: 12
i just finish basic c++ and i wanna begin making 3d and 2d games i just dont know which one I should choose direct X or openGL.

so which one should i choose and why? and also what would it take to make my own ?
Last edited on
closed account (N36fSL3A)
This is more of a lounge question.

If you're looking to create games for windows only, go for direct X.

Else, if you're going develop for other platforms as well, go openGL in combo with SDL or SFML (Doesn't really make a difference)

For 2d games, I'd recommend SDL or SFML. Go for 2d games first, then 3d. These should get you familiar with graphical programing before tackling the two beasts in the thread name. ;)
closed account (o1vk4iN6)
Opengl and Directx aren't even beasts... they are relatively straight forward to use.
closed account (N36fSL3A)
Beasts compared to SDL/SFML in my opinion.
Last edited on by Fredbill30
I prefer OpenGL because it's cross-platform.

My advice would be to ditch the fixed-function pipeline you see in many tutorials and write shaders from the off. Disch provided a link to tutorials do this in another post. http://www.cplusplus.com/forum/beginner/104822/

sumsar wrote:
and also what would it take to make my own ?

Make your own what? Low-level graphics library? Probably a lot more than you're willing to invest.

EDIT: Tom Dalling's Modern OpenGL series is pretty good too, though it's kind of unfinished at the moment. Still worth a look. http://tomdalling.com/blog/category/modern-opengl/
Last edited on
I hear OpenGL is free and Direct X is costly. If that is a factor. As far as performance goes they should be equal but OpenGl is cross-platform and I believe Direct X is a microsoft thing, for windows and x-box.

The x-box gets it's name from direct x. But OpenGL is only a graphics api. Direct X is the total deal. There is direct draw, direct sound, direct ass, you get the point.
okay thanks for your help :)
I would choose OpenGL. Just make sure you avoid old tutorials and stuff. Use vertex buffer objects (VBO's), and render using glDrawArrays, or glDrawElements, and not glVertex3f.

Also like someone mentioned, use shaders. Read up about the OpenGL shader language (glsl) before you get started.

You can use SFML just for the window, controls and sound, or there is also a popular library called GLWF which handles controls, and window and then use OpenAL for sound.

Also there is OpenGL ES which is a subset of OpenGL and works on mobile devices. If your planning on porting to android later or something, you could consider using OpenGL ES.
Last edited on
OpenAL...

Never heard of that one before. Sounds like the makings of a group of api's that complete the game dev arena. What do they call the grouping? OpenXL or just OpenX?
Yet another opengl vs directx.

@manga
openal is used quite often with games using opengl.
what about openGPI(open game programming interface) :p
Last edited on
what about openGPI(open game programming interface) :p


whatever... lets just vote on a name and spread it around until it catches on.
I hear OpenGL is free and Direct X is costly.

To use? They're both free. You might have to pay some sort of royalty if you want to sell anything that uses DirectX, though. I'm not sure. But if you're just learning chances are you won't be selling anything anyways,
maybe directx is free? I must have read false info before.

Edit

I just confirmed that the directx sdk is deffinately free. Google pooped the link right up. Thanks alot ResidentBiscuit, now there is yet another api I'll have to learn. :P
Last edited on
It could be OpenLib.
What about adding this:
http://openil.sourceforge.net/
Sadly they have been "forced" to change into DevIL, but link says it all.
If I had to choose, my first choice would be to learn OpenGl, but I must admit microsoft sometimes finds a way to appeal to newbies like me. When I first wanted to learn C++ I wanted the GNU C++ compiler. I have heard good things about it. But when I went looking for it, the websites were so confussing I became frightened. I did not know what to download and could not figure it out. So I went after the visual C++ express 2010 compiler. Microsoft made it all too easy. Just one big red button labeled download.

I allready saw that the directX SDK is easy to find, easy to download. If OpenGl gives me the fits when trying to get started then DirectX it is!
Well, many times even Microsoft installs OpenGL by default, you should have it already (but no docs for offline view).
As for DirectX, it gets set-up by its SDK installer.
You run the SDK installer (making sure your VS is closed) and you're done.
There will also be a "DirectX SDK" entry in your Start Menu, showing some DirectX code examples (Useful for example for DX11 tessellation and other examples/tutorials) and the full documentation is offline.
@manga,
you probably were looking at the wrong place for the gnu compiler,in the first place it is not for windows but for OSs based on POSIX (unices , BSDs and linux) which windows isn't, you need to install MinGW instead (stands for "minimalistic gcc for windows") which will allow you to run gcc on windows.

And what you want is probably an IDE not just the compiler, so i suggest you codeblocks.(it has a nice download page where you can easily install codeblocks along with mingw).
thanks amhndu...

You see nobody explained it to me before. I suppose for now I'll say with what I got but maybe one day I'll give it another go. In the end I'd like to say I am familiar with a wide range of applications.
np.
Did you at first tried using a search engine with keywords 'gcc windows'...

why not make the change now?
I mean vc++ locks you down to windows as well as you have to pay for commercial use.
Pages: 12