Jump to content
  • Advertisement
Sign in to follow this  
furnace

Shall I become a DirectX or OpenGL beginner?

This topic is 3679 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wrote quite a long post initially, but here's a short version saying exactly what I want to say, just without the blah! - I have an idea for a game that only I will probably ever play, and will be developed for Windows. - It will be my first game. - My job is in application and internet development and I know enough to be confident that I can actually do this. - I already know very basic OpenGL, e.g. I can draw triangles and move them. - I don't know any DirectX. - I don't want to learn OpenGL if DirectX is "miles ahead" or OpenGL is not "worth" learning for any reason. - I'm worried about DirectX keeping me bound to Windows, but in reality, I'll only ever write a Windows game anyway, and the only console I own is an xbox 360. So, what do you think... Do I build on the very basics I've already learnt in OpenGL, or do I start again and learn Direct3D/DirectX? Thanks for your opinions!

Share this post


Link to post
Share on other sites
Advertisement
Work with what you're most comfortable

If, in the future you decide to change - the skillsets are transferable
The 2 apis actually have alot in common
As for abilities & "features" - they don't arrise until you get much, much deeper
Capabilities are still pretty much equal for both

But don't worry too much, from the onset
Get stuff done first :]

Share this post


Link to post
Share on other sites
Quote:
Original post by furnace
I wrote quite a long post initially, but here's a short version saying exactly what I want to say, just without the blah!

:)

I'd say, stick to OpenGL. Especially for a first game, any differences in capabilities are not going to hinder you anyway (simplistically said, if one is capable of pushing 10.000 poly's and the other 100.000, does it matter if your game only needs 1.000?).


But actually, OpenGL is probably too low-level if you just want to get a game done. Take a look at SDL, Allegro or Haaf's Game Engine. Much of the core functionality that most games need is readily available in the form of frameworks and engines, so pick one that's suitable and go with it. Hey, I've even seen some great games built with Gamemaker, and personally, I prototype a lot in Flash and also Python. It's relatively quick and easy to work with so I go with it. :)

Share this post


Link to post
Share on other sites
To allay any fears about performance in OpenGL - This is no magical difference in performance between the two
They will both perform as fast as one-another if they are fundamentally doing the same thing

Speed differences only occur when you start to make use of more advanced features, designed to optimise performance for specific scenarios
(Both gl & d3d have slightly different approaches when it comes to some of this features, but there is no clear decider)

Either one is as good as the other

But what Captain P said @ the end also holds true - Whatever is fastest & easiest for you to develop in should be your choice - weather this be direct gl, or a high level api

Share this post


Link to post
Share on other sites
I personally like DirectX because that's the one I originally learned to use. But, now I'm wondering if OpenGL would be just as good. Does anyone know if OpenGL is used in any major games on the market?

Share this post


Link to post
Share on other sites
DirectX is not "miles ahead" of OpenGL, just get updated more often. As others said, they do the same things with the same performance except for advanced concepts you shouldn't bother yet. You shouldn't become a DirectX OR an OpenGL programmer, you should know both. Anyway, once you know one it's pretty much the same thing for the other or any API you can find.

OpenGL often get points for being multiplatform unlike Microsoft who own all rights on DirectX, but as you said you, and most people, won't ever want to program a game on any other platform than Windows and x360 anyway.

Share this post


Link to post
Share on other sites
You have an interesting conundrum on your hands. The real question you should be asking yourself here is "What do I want to do with my knowledge after?"

It's been said here and in many other places OpenGL has been rapidly losing the 3D API wars for some time now and will probably continue to do so in the future. As such, it makes little sense to invest a lot of time and effort into using a system with a limited future ahead of it. Hell, John Carmack himself has really abandoned ship with id Tech 5.

So basically if you're interested in really taking your newfound ability somewhere, (i.e. doing this more later) go DirectX. If you're just interested in messing around with your one pet project, stick with OpenGL.

With all this being said, I'm a huge DirectX fanboy and that's what my personal recommendation's going to be. In all honesty OpenGL's really not even designed for taking full advantage of current 3D architectures and paradigms.

Share this post


Link to post
Share on other sites
You shall not become an OpenGL nor a DirectX beginner, you shall become a 3D beginner.

Whether you use OpenGL and DirectX matters little. OpenGL is just more low-level; DirectX will try to do everything for you.
It might be better to work with OpenGL if you want to gain a better understanding of 3D.

OpenGL might not allow you to make optimal use of the graphics card in all cases, but anyway heterogeneous development over both the CPU and the GPU is a difficult subject.
You may also want to look into a GPGPU solution as an alternative to resorting to another 3D graphics API when what you would like to do is not made available by OpenGL.

The algorithms are what is really important after all, and be them executed on the CPU or on the GPU through a graphics API matters little when you're learning them.

Share this post


Link to post
Share on other sites
From experience using both APIs quite frequently, it really doesn't matter which one you choose. Once you're comfortable with either one you'll be able to pick up the other and hop back-and-forth easily.

I'm inclined to suggest that you stick with OpenGL so that you can get a grip on the concepts without having to start all over again. Then when you inevitably work on a DirectX project it will be simple to look in the docs and ask "How do I do what I was doing in OpenGL, but in DirectX?".

On the other hand, if you feel like it then by all means feel free to take DirectX instead. It's actually a very short-term decision, not a lifelong commitment, even though it may seem that way at first.

Either way, here are some suggestions to make the learning process easier:

-The biggest and most complicated part of either API is the fixed function pipeline. I recommend that you ignore it completely - the programmable pipeline is better and easier, and hardware support is pretty much ubiquitous these days.

-Learn how to write vertex and pixel shaders (easy if you keep it simple - BTW in OpenGL these are referred to as vertex and fragment programs), and draw batches of polygons using those shaders. Then throw in textures and maybe render targets and that's pretty much all the tools you need from the API to do some amazing graphics. Simple, isn't it?

-Is window-handling or other menial code distracting you from what you're actually focusing on learning? Just use SDL and it will all be taken care of for you. Works with DirectX, OpenGL, or even just by itself.

-If you want access to the latest OpenGL features, you can use a library such as GLEE. (alternatively there as the GLEW library, which does the same thing but gives you a bit more control). With DirectX you can access new API features by upgrading your DirectX API.

Share this post


Link to post
Share on other sites
Why not have both?

You can use for example Ogre3D rendering engine ( http://www.ogre3d.org/ ). It abstracts the choice between DirectX and OpenGL away from you. You don't need to write any DirectX or OpenGL code if you use it. It has been written already by pro 3D programmers.

Porting your game to other platforms becomes much easier if you use it.

There are also *game* engines which use Ogre3D, free and commercial.

Head over to http://www.ogre3d.org/ and start reading.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!