Sign in to follow this  

Which API to learn first?

This topic is 4304 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

Okay, What should I learn first (basically which is better)? Open GL or DirectX? I know some very basic Direct X and I was wondering which has more power, easier to work with, etc. Eventually I want to know both. But lets say I want to write a good game within the year. Which is going to give me a better endproduct?

Share this post


Link to post
Share on other sites
why not both?
you can make a game in both APIs bit by bit if you really want to learn DX and OGL. other than that flip a coin and go with the decision. it seems they both are on equal footing*.

*granted that by the gathered opinions of the more professional programmers here.

Share this post


Link to post
Share on other sites
They drive the same underlying hardware. The one that will allow you to write a better game is the one you are most familiar and comfortable with. Since you already know some of DX, you may as well use that.

Neither API is, from a technical standpoint of what you can and cannot do with it, generically better than the other. You can write a pretty game in both, or you can write an ugly game in both. That part is up to you, not the API.

EDIT: My comparison is specifically between OpenGL and Direct3D here, not OpenGL and the entirety of DirectX. DirectX includes components for audio and input processing, et cetera, that OpenGL doesn't offer; you'd have to use other external libraries for that if you elect to use OpenGL for your rendering.

Share this post


Link to post
Share on other sites
So basically they are completely the same? I mean, Direct X is annoying to start up, and I want to create a "Library" or whatever that simplifies it, but I don't have the skill.... Should I just plunge into the heavy code, or will "simpling" it be a better course of action?

Share this post


Link to post
Share on other sites
This is about the most flamebait question you can ask on a game development forum, but here's a simple answer; if you're comfortable with C, go with OpenGL. If you're comfortable with C++, go with Direct X. If you want your app to be cross platform, go with Open GL. If you only are concerned with Windows, go with DirectX.

Both APIs are very powerful, both are reasonably easy to use if you have the basic mathematics down, and both can generate equally good end products (a lot of professional game companies will build their engines in such a way that the underlying API doesn't matter, and can be selected by the user). It's a preference and target audience call.

Share this post


Link to post
Share on other sites
Quote:
Original post by Plasmarobo
Should I just plunge into the heavy code, or will "simpling" it be a better course of action?


Software reuse is always good, so I would suggest you simplify it by writing helper classes. You can write an "App" class that initializes stuff, and use it in every project without having to create a window in every single program you write.

I have also found that this is a good way to learn graphics techniques. For example, when you learn texturing, you can add a Texture class to your library.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This is subjective, but I'd say that OpenGL is by far the easier to learn, especially if you're learning about programming and how to structure code at the same time too.

I read a book about OpenGL one weekend many years ago and felt very comfortable writing my first programs with it straight away. At this point I'd already written software engines and OpenGL seemed (and still does) very well designed, transparent and easy to use. At that time DirectX was in an early incarnation and stank, I don't think anyone disagreed at the time.

I helped port a PS2 engine to the XBox a couple of years ago and I still couldn't get the nasty taste of DX out of my mouth, although DX is undoubtedly much better, it was still more painful than it should have been.

I'd advise learning OpenGL first, because it's well designed, transparent and works in a well structured way and then learn DX once you've got your head around hierarchical transforms, lighting pipelines, fixed function material properties & shaders etc.

Here's a great place to start:

http://nehe.gamedev.net/

This is just my view so please feel free to ignore.

Good luck whatever you decide to do, writing rendering engines is fun!

:-)

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
This is subjective, but I'd say that OpenGL is by far the easier to learn


I believe it is not subjective. OpenGL is a C library, and it is rather simple to grasp the main concepts behind it (the state machine, and so on). The API are clear enough, and it is easy to cope with the extensions.

DirectX, on the other hand, requires you to understand some bits of the COM architecture, speaks about managed/system/whatever resources, let you play with the "device lost" funny stuff and is simpler to use in a C++ environment than in a C environment.

As a conclusion, OpenGL is easier to learn than DirectX.

Now, I must admit that I suck at OpenGL and that I really enjoy programming Direct X, but that's a totally different matter :)

Regards,

Share this post


Link to post
Share on other sites
Alright, so I guess I'll try openGL first, 'cause I have never actually taken a lession on C++, this being my first year of HS, and it is not offered at my school. I would say that Microsoft in general makes things more painful than they need to be, but they add a bunch of stuff inside that.

Share this post


Link to post
Share on other sites
Is he asking if he should learn OpenGl or D3D or is he asking between OpenGL and DirectX?...because directx and opengl cant really be compared. DirectX is a media lib, OpenGL is graphics only.

Good luck

Share this post


Link to post
Share on other sites
Okay, I pretty much know C++, I mean, I don't know every little function of the stl, but I have a bunch of reference books so that I don't have to memorize it. I remeber things that I find helpful. I know BASIC, DARKBASIC, and DARKBASIC Pro as well. I don't know C, but that is pretty much just C++ w/o oop.

OpenGL seems less confusing, but it doesn't want to work with either of my compilers (I belive that I installed the SDK wrong) so that leads me to belive that DirectX is more solid, since I didn't really have the option of installing it wrong. I can create windows programing, so I know the basics of WIN32, and I managed to make a blue screen on directX somehow, but that doesn't mean I know anything. My biggest problem is Syntax, or lack of knowleged. I try to do things that I have no Idea how to do. I kinda need an editor for my work how can correct stuff, but since OpenGL is more open and cross platform it makes that atractive.

And yes, I guess it would be more of a
D3D vs OpenGL, but that fact that DirectX is a unit makes it even more attractive, all your eggs in one basket, so to speak.

Share this post


Link to post
Share on other sites
be careful, there are plenty of people who have crossed this board and had a hard time getting DX to work with Visual C++ (6, 7, 8, 2005). So easy integration doesn't mean better API. I would suggest that you familiarize yourself with C at least before jumping into OGL (or C++ if you're going to use DX) (for the record, you can use C or C++ for DX or OGL).

Share this post


Link to post
Share on other sites
If you are content starting with 2D graphics, you might want to check out SDL. It is extremely easy to use and you can use it as a great stepping stone to 3D with either OpenGL or Direct3D.

Share this post


Link to post
Share on other sites
Quote:
Original post by Simian Man
If you are content starting with 2D graphics, you might want to check out SDL. It is extremely easy to use and you can use it as a great stepping stone to 3D with either OpenGL or Direct3D.


That's the path I'm taking.

Share this post


Link to post
Share on other sites
Quote:
Original post by Plasmarobo
Alright, but I heard that it can be very difficult to use SDL to its full potential..... I will give it a try though.


Who ever said that is on crack.

SDL is easy as APIs get. Hell I only used SDL for a little over a year before I made my tutorials.

Moving onto OpenGL with SDL (which is SDL's true power) is a bit of a stumbling block because of the lack of examples (I plan to change that in about a year 1 1/2 [wink]). But once you manage to draw a quad on the screen it's smooth sailing from there.

Share this post


Link to post
Share on other sites
Quote:
Original post by Plasmarobo
Alright, but I heard that it can be very difficult to use SDL to its full potential..... I will give it a try though.

It is close to impossible to use any API to its full potential, but don't let that discourage you, because it doesn't mean that it is hard to use the API for the basics.

Share this post


Link to post
Share on other sites
You guys make a year sound like such a small amount of time.
My plant is to know DirectX by the end of Sophmore year..... Is that realistic? I learned C++ in about a year... well actually it was more like 3 months spread farrr apart. Thanks for you encouragement!

By the way Lazy Foo' Those are great tutorials. The visual setup instructions were superhelpful.

Share this post


Link to post
Share on other sites
Quote:
Original post by Plasmarobo
You guys make a year sound like such a small amount of time.
My plant is to know DirectX by the end of Sophmore year..... Is that realistic? I learned C++ in about a year... well actually it was more like 3 months spread farrr apart. Thanks for you encouragement!

By the way Lazy Foo' Those are great tutorials. The visual setup instructions were superhelpful.

to know DX (or just D3D) in 3 months..... honestly, no.
a year is a good amount of time. you'll might have the program up and running in 3 months. understanding and replicating particular algorithms and concepts without the book/net/reference holding your hand will definitely take far more than 3 months.

Share this post


Link to post
Share on other sites

This topic is 4304 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this