DirectX vs OpenGL? [closed] - opengl

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I saw the articles that were going on about OpenGL being better than DirectX and that Microsoft are really just trying to get everyone to use DirectX even though it's inferior so that gaming is almost exclusively for Windows and XBox, but since the article was written in 2006 is it still relevant today?
Also I know plenty of games are written in DirectX but does anyone have any examples of popular games written in OpenGL?

Look at the facts. For the last decade or so, nearly every PC game has used DirectX primarily. Early versions of DirectX (think DirectX 4.0) were pretty awful, but it's been a long time since DirectX has been "inferior". Do you think Microsoft bribes game developers to use their API? Or could it simply be that their API was a better choice?
In fact, you could make a good argument that the opposite is true, because DirectX improved. Until around two years ago, OpenGL didn't. OpenGL was stuck with a ridiculously obsolete core feature set, and a million extensions that a developer has to navigate, some of which are available on one GPU, others are available on another, and sometimes they're compatible, sometimes they're not.
OpenGL has moved quickly to catch up since then, but that's exactly it. OpenGL has been catching up, not speeding ahead.
Then there's the tools argument. DirectX has amazing tools available for developers. PIX can do really impressive things for debugging, and it was available for free. And PIX was just one of the many tools made available for free by Microsoft.
OpenGL had, uh..... gDebugger. Which could inspect a few textures and the state of various gl objects, and it cost money.
I won't say one API is, or was better than the other. But there are very valid reasons why so many PC developers have flocked to DirectX for the last decade or so.

At least all games by Id software (and all games using their engine) use OpenGL, if I've understood correctly.

Related

Is there any viable GPU accessing alternative to OpenGL [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking to do some programming on the GPU but don't need any sort of 3D or high level graphics capability. Essentially all I need to do is call functions that loop through thousands of iterations very quickly. I started looking into OpenCL but it seems that support for that is much, much lower that OpenGL as I can use OpenGL ES even on mobile and WebGL on web. Web isn't that big of an importance to me at this point, but is there a viable alternative that has the wide support that OpenGL has but more used for calculation? I want something that will be able to run on as many computers and devices out there.
EDIT: I'm also looking for the best support of various graphics cards from AMD, Nvidia, etc.
OpenCL is supported by both main GPU manufacturers and is by far your best bet. The other alternative is CUDA. I think you would be better off asking a question along the lines of "How do I solve this problem using OpenCL?" than simply stating that it is not suited for the work you need done, as it is very hard to make recommendations based solely on the description above.
Please also note that OpenCL supports an embedded profile, which means it has some support on mobile devices. However the iPhone does not currently support this. It was rumored that it would be coming to iOS 6 but this seems not to have happened yet.
Also see this question which explains how android and OpenCL function together.
I guess for NVIDIA cards the best model to use is CUDA. It's pretty mature by now and very well supported. You can find many guides on the main site and they're well written so you should be able to pick it up quickly imo.

Win32 still best for Windows game development? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking to start a new project to work on in my free time that covers a lot of areas of Computer Science and I've decided on a game (most likely flight simulator or simple 2D side-scroller). Anyway, I do a lot of C#/Java development at work writing business applications so I'm looking to do a game in C++ (I have used C#/XNA for games previously).
However, I'm trying to find a good framework for C++ game development. I have used Qt before but don't believe this is suitable for what I am trying to achieve. Is Win32 and OpenGL still the best for C++ game development?
Also, I want to keep this pretty OO, any recommendations for wrapping the Win32 for game development? Or does OpenGL provide abstractions to help?
From what I've experienced, the Win API is a complete mess. I'd recommend using something like SDL and save yourself the trouble. As a bonus, this will also make it cross platform. You can also use OpenGL with SDL.
SDL is still a bit low level and has a C style API, so you'll need to write your own OO wrappers. I've heard that SFML and Allegro are popular alternatives but I have less experience with them.
SFML is probably the closest you can get. Most people using 2D rendering roll their own, and most using 3D go with either something like Irrlicht, or roll their own.
As for OGL, the OGL API is horrific- it's even worse than the Windows API. At least that is OO, C-style, instead of just plain old global-variables-up-wazoo.
Check out GLFW. It looks to be minimalistic (in a good way).

Why isn't OpenGL used in the majority of today's blockbuster games? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
My friend came up with this simple question: Why do the "big" titles of today almost all use DirectX, and not OpenGL?
Are there specific technical reasons, or is it all Microsoft's marketing?
Probably to make porting to XBox 360 easier.
Datenwolf is right in that most games are probably OpenGL just by sheer number, a claim that is very hard to substantiate. In the windows world, Microsoft did a great job at marketing DirectX over OpenGL. It helps that every game for years would say you need the latest DirectX on windows. After that, it's just momentum. If a development company wants to find the API that they can find programmers for, then they need to find the platform that has the biggest backing. Programmers learn to use DirectX for windows because of the amount of windows game developers that use directX. "I'm unhappy because I eat and I eat because I'm unhappy, it's a vicious cycle" hahaD
I don't know where you got your figures from, but last time I checked most games used OpenGL for their graphics stuff. Nintendo Wii, Playstation 2, 3 and the portables (due to comments ignore that), MacOS X, iOS (iPhone, iPad), Android they all use OpenGL (in some variant). So any game running on one of these actually is using OpenGL. In Windows DirectX is majorly used becauseā€¦ Honestly I don't know why.
EDIT: Even without being used on Nintendo and in most Playstation 2 & 3 games, there are still iOS and Android devices, which are a huge market, where OpenGL is the 3D API to be used.

Up to date OpenGL tutorials or books for c++ [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm new to OpenGL, I'm on Linux and have an NVIDIA card that supports OpenGL 3.2.
I'd like to learn from the most recent changes of OpenGL. I'm looking for C++ tutorials or books of OpenGL 3.0+.
I know this question has been asked frequently but all the sources seem to be old or the tutorials are in C. I couldn't find a decent tutorial with this criteria so feel free to suggest books too. Thank you.
Get a copy of the fifth edition of the OpenGL Superbible. It comes with a C++ library for use with OpenGL, and only covers the modern programmable pipeline.
I like this tutorial, but it's being written, so it only has 4 chapters right now
http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html
OpenGL Programming Guide, 6ed. It is current as of about 18 months ago.
If you are new to OpenGL, there is not much point in worrying about the latest & greatest features of v3.2... OpenGL builds on it's own concepts from version to version. You need to understand the basics of OpenGL before the very newest bits make any sense. While learning the basics you will find out what new parts are useful to you.
That said the org that manages OpenGL is called Khronos. This page has links to the standards docs and extensions: http://www.khronos.org/opengl/.
But really, learn the basics first: that and a bit of reading on the side will point you at what extensions or new features are worth your time.
[edit] As has been noted by other people in this thread: OpenGL is a C API.
There are C++ wrappers but in my experience they are more trouble than they are worth, they each impose a model of using OpenGL... but OpenGL is really just a collection of C functions and using it as such gives you the most flexibility.

Books/resources on learning Xlib ("the Linux Petzold"?) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have stubbornly decided to learn Xlib programming for Linux GUIs, just for fun & the gained experience. I'm young and have lots of time to read useless stuff. Nobody seems to want people to learn this, though, as everywhere I look, askers are being bombarded with suggestions of using a toolset instead - usually Qt or wxWidgets. This is kind of sad, if nobody learns Xlib, who will continue development of e.g. wxWidgets? I will learn wxWidgets too, though, when I feel comfortable with Xlib.
So - with that out of the way - my question is: Is there a recommended book (or other resources) for learning Xlib programming, preferably with C++, but C is OK too. Windows programming has its Petzold, I was wondering if Xlib had some sort of equivalent.
There used to be a whole series of books on X programming (they actually worked their way up to Xlib!) but the one you probably want is Xlib Programming Manual
Over a year later I ran across a "retro UNIX" imgur album which has a picture of it! Keeping good company with the Red Book (the Postscript Language Reference Manual) and another in the O'Reilly X series.
I found this on amazon: Fundamentals of X Programming
I liked one by Levi Reiss and Joseph Radin, I think it was "X Window inside and out" (I read a translated version). Of course, it's really outdated, and predates Xutf8* functions, XRender, XFt and client side fonts, XCB, XRandr, Composite, etc...
Also found these books myself:
http://www.amazon.com/Introduction-Window-System-Oliver-Jones/dp/0134999975/ref=sr_1_4?s=books&ie=UTF8&qid=1288651669&sr=1-4 (old and expensive, but it's something)
http://www.amazon.com/Window-Programming-Scratch-Jesse-Libertys/dp/0789723727/ref=sr_1_25?s=books&ie=UTF8&qid=1288651711&sr=1-25 (this one is quite recent, compared to most other resources I could find, but it's got some bad reviews. Maybe worth the read)
http://www.amazon.com/Window-Toolkit-Complete-Programmers-Specification/dp/1555581781/ref=sr_1_44?s=books&ie=UTF8&qid=1288651754&sr=1-44 (supposedly good, actually on Xt, but I guess it might be worth the read)
And this website which seems to at least contain something usable:
http://manuals.itc.virginia.edu/unixdocs/u014.xwindows.html
If anyone has read any of these, please leave a comment.