OpenGL or DirectX?


In some games I saw there is an option called Renderer:
I can choose one of them but what does it mean? Does the game is written on OpenGL and also on DirectX ???


Hi !

Yes, if you can select OpenGL or DirectX (I guess it says Direct3D), then the application/game has two rendering engines, one for OpenGL and one for Direct3D.


I admire those people. Building a game with 2 other rendering engines is hard a work, I suppose. You need 2x time more to do that.

Yeah no kidding! I mean who would want to take the time to program in D3D if you can already do it in OpenGL??? Just messing! Yeah it’s pretty cool how they support both APIs. It isn’t necessarily twice the work though. I mean yeah it’s a LOT of work getting both of them implemented, but a graphics engine is only a small part of the whole game engine. But it’s the most fun part!!!

  • Halcyon

Correction, it would NOT take 2x the time, because the vast vast vast majority of a game is not API calls. If you create a good abstraction layer for rendering, then adding support for an additional API would maybe increase project completion time by 5%-10%.

But still there aren’t many games written on both OpenGL and DirectX. If you choose single graphics library you can optimize your project for the specific API. Is there any sens of making a game in both ways if one of them would be faster?

Some companies might do it to make up for inefficient drivers on some cards. I know that S3’s OpenGL ICD was REALLLY slow on our laptops at work, but their DirectX performance was a lot better.