Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Direct3D work only on Windows?

What is the Direct3D? It is an API, is not it? Is it implemented by Windows or by graphics cards?

If the graphics cards implement the Direct3D API, why can not other operating systems use Direct3D resources from the graphics card?

If Direct3D is implemented by Windows, it has to use graphics card resources, such as OpenGL or OpenCL. If Direct3D calls are not directly to the graphics card, it would be slower due to intermediate calls.

Please, help me to understand what the Direct3D is.

like image 908
Squall Avatar asked Nov 04 '22 23:11

Squall


2 Answers

What is the Direct3D? It is an API, is not it? Is it implemented by Windows or by graphics cards?

Yes, Direct3D is an API. It is implemented (mostly) by Windows itself. However, Windows will offload a considerable part of the actual work to the drivers of the graphics card and ultimately to the gfx card itself, so one can also say that a gfx card "implements" D3D.

If the graphics cards implement the Direct3D API, why can not other operating systems use Direct3D resources from the graphics card?

They can, and they do, but only a relatively small (but often critical part) of D3D functionality is implemented directly by the card's hardware, so a lot more work in software is required to implement D3D.

If Direct3D is implemented by Windows, it has to use graphics card resources, such as OpenGL or OpenCL.

No, that's a misunderstanding. OpenGL and OpenCL are also APIs, and only partially implemented by the gfx hardware (just like D3D). The gfx hardware usually has a (proprietary) "native" API, which is what the gfx drivers (both for D3D and OpenGL) use.

If Direct3D calls are not directly to the graphics card, it would be slower due to intermediate calls.

There are not necessarily any "intermediate calls" - the D3D driver uses the cards native API, as explained above.

like image 57
sleske Avatar answered Nov 10 '22 18:11

sleske


Direct 3D is a graphics API created by Microsoft. Its similar in function to opengl. OpenGL is a competing 3D graphics API created as a open standard. D3D doesn't need OpenGL to function.

Card manufactorers decide which APIs they want to implement; most always include DirectX (which includes Direct3D) and possibly OpenGL.

There is indirection as it doesn't go directly to the card, the cards D3D in turn calls the drivers, but this typicially is insignificant.

like image 23
Andy Avatar answered Nov 10 '22 20:11

Andy