Best Graphics to use C++ ?

Started by
6 comments, last by jpetrie 12 years, 2 months ago
Soon, I will start trying to use graphics but first I was wondering which is the best to use and the most versetile. OpenGL or DirectX ? Which one of the two is better to learn ?
Advertisement
It depends on what your goals are. Both are good.

If you want to focus just for Windows stuff, DirectX would probably be your best bet. If you want to make things available for more systems, then OpenGL would be a better choice.

One isn't necessarily better than the other.They both do the same kinds of things.(And by same kinds of things I mean OpenGL vs Direct3D. DirectX also does sounds and input.)
Do you care about cross-platform development on linux, apple and portables.
If yes, you have no choice. OpenGL.

Are you a learner wanting to just get introduced to the tech? Do you just want to understand the basics on your an then move on? Direct3D 11 on the appropriate feature level.

To be completely honest, I strongly suggest against OpenGL at this point.

Previously "Krohm"

Either one will be OK for now, because once you get to master one, it is very easy to learn the other if you really need to.
Both operate on the similar principle in the background, the only difference really is syntax of the API and the API. Once you understand the ideas behind them you can use both with a reference manual handy.

I'd suggest writing shaders in CG and integrating CG into GL and DX as that will allow you to write shaders in a API independant way. CG is capable of translating itself into GLSL or HLSL symbols depending on which API is used.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion


Soon, I will start trying to use graphics but first I was wondering which is the best to use and the most versetile. OpenGL or DirectX ? Which one of the two is better to learn ?


Basically the 2 APIs are roughly equivalent in terms of features and performance today with 2 notable exceptions:

1) Intel has shitty OpenGL drivers on Windows(and Linux, but you don't have much choice there (not sure about Mac)), nvidias glsl shader compiler isn't very strict so shaders that work on nvidia hardware might not necessarily work properly on AMD hardware(It is a good idea to test your OpenGL shaders using AMD hardware for this reason) (AMD and nvidia both provide solid OpenGL performance today though), If you want to get the most out of Intels low end integrated GPUs on Windows then you should use D3D.

2) D3D is only available on Microsofts platforms, if you want Mac/Linux/BSD/whatever support then you need to use OpenGL, (iOS and Android use OpenGL:ES which is similar but not identical to OpenGL).

If you're only targeting Windows then D3D will give you less headaches, if you're only targeting Mac OR Linux then go with OpenGL. (You really shouldn't target more than one platform if you're writing "low level" code as a beginner)

If you are making a game (Rather than playing around with low level graphics APIs for learning purposes) then you should seriously consider using a higher level game engine instead or atleast a game oriented framework. (This also makes crossplatform development alot easier as you can avoid dealing directly with the underlying OS)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
<snip>awesome</snip>


This pretty much sums up the situation as well as can be. The only thing worth adding is that D3D tends to have better documentation and tools available, which are quite invaluable things to have.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This question has been asked and answered hundreds of times; please search the forum.

This topic is closed to new replies.

Advertisement