7 ms·
It's a really stupid question (but this does not take away from the value of the incredible first answer). It makes a huge, blind assumption (running on Windows
by ComputerGuru 14y ago
It's a really stupid question (but this does not take away from the value of the incredible first answer). It makes a huge, blind assumption (running on Windows means using DirectX and explicitly not OpenGL) and ends up assuming correlation implies causation.
There are many Windows-only games written in OpenGL, and the ones that are written with DirectX is not necessarily because DirectX is better but because there are more consumers for Windows.
The short and simple answer is that "real," modern games are ridiculously expensive projects. The highest percentage of PC-gamers can be found (at the moment) on Windows. Ergo, you will write Windows games and use libraries (OpenGL, DirectX, or otherwise) that are available on that platform.
- phaus 14y agoIt was a dumb question, but if you scroll down, someone responded with an awesome history of the war between Direct X and openGL. I'm pretty sure that's why it was posted here.
- siamore 14y agoyour'e right, the top answer provides great insight. I was actually surprised it wasn't already posted here.
- blindhippo 14y agoI wouldn't say it's a stupid question. It's a broad question seeking a better understanding that most of us take for granted. And it clearly was treated as a good question by the absolutely astonishing answer it garnered. Humanity is better for this exchange on Stackoverflow - we need more discussions like this.
- chill1 14y ago"Humanity is better for this exchange on Stackoverflow - we need more discussions like this." Outstanding. Made me smile. I appreciate the level of grandeur you are attempting to bring to bear on this discussion, but this is a discussion about Game Development by the way.
- danso 14y agoSo? Richard Feynmann's Nobel Prize winning idea was, in his retelling, inspired by some guy throwing a plate in the Cornell cafeteria: http://demonstrations.wolfram.com/FeynmansWobblingPlate/ http://demonstrations.wolfram.com/FeynmansWobblingPlate/ The "amazing" part of the OP's discussion is not the immediate topic at hand, but that someone took the time to go past the pat answers ("because Windows has more users, etc") and consider all the other factors that have led to things being the way they are. If only more important fields -- education, medicine, politics, justice -- had more people willing to spend a summer hour examining their deeply-held assumptions.
- kristiandupont 14y agoI don't see him making that assumption. It's the other way around: using DX means Windows, which is correct. Even so, he is asking if this could be the reason and I don't see how this is a stupid question.
- FaceKicker 14y agoAs someone who's never done any game development at all, can you give me some sense of the work that would be involved to port a Windows-only OpenGL game to Mac or Linux? What pieces of it would need to be redone or significantly overhauled? I would have expected it would be quite minimal compared to the work involved in developing the game itself, but I guess I must be wrong if there are "many" Windows-only OpenGL games.
- munchbunny 14y agoThe main difficulty in porting has less to do with OpenGL itself and more to do with the number of platform-specific issues you encounter when you're trying to port code that is highly optimized for specific platforms.
- FaceKicker 14y agoInteresting, can you give any examples of these issues?
- AnthonyMouse 14y agoThey're almost all program and language dependent. If your game doesn't use threads, you don't have to port anything to do with threads. If it does, but you use Java or C++11 and their platform independent thread libraries, you (ideally) don't have to port anything to do with threads. But maybe you used C or C++98 and now you have to run around putting in ifdefs for CreateThread vs. pthread_create and debugging subtle differences between Win32 and POSIX threads, etc. Or maybe you decided to write the whole thing using multi-platform libraries like Qt in the first place, so that you don't have to change hardly anything. Or maybe you wrote it in Visual Studio using .NET heavily and you have to practically rewrite everything from scratch. It's totally dependent on the decisions you made when writing the original program.
- munchbunny 14y agoIn addition to what AnthonyMouse said, it also gets a bit more complicated than that. If you have a high performance game engine, it's very likely that the inner loops are written in assembly to squeeze every last drop of performance out. The guys who write this code are optimizing for the OS's memory handling behaviors, aligning data to fit into cache lines, using SSE instructions for faster matrix multiplications, and all sorts of other exotic techniques that "mere mortals" don't even think about. So when you change platforms from, say, the Xbox 360 to the PS3, those assumptions you made about the OS, the CPU, the chipset, and other minute details are suddenly completely, horribly wrong. So the guy who wrote all of that highly optimized code has to write it again to optimize against a completely different set of quirks.
- listic 14y agoSo are indie games, notgames, and Minecraft all not real for you? Reserving the term "modern games" to only "ridiculously expensive projects" and dubbing the rest "not real" is... just one point of view. What's interesting to me is the fact that makers of indie and notgames, that do not require the enormous scale and pushing the hardware and programmers to their limits - they often make them for Windows, too!
- doomlaser 14y agoThe highest percentage of PC-gamers can be found (at the moment) on Windows. Ergo, you will write Windows games and use libraries Indie game developers want to reach the largest audience as well, so I don't see the difference. Additionally, the fact that Windows has such a high marketshare among consumers means that it likely has a high marketshare among indie game developers from the get go.