By using this site, you agree to our Privacy Policy and our Terms of Use. Close

Forums - Gaming Discussion - What DirectX is, and why you will not see it in a non-Microsoft machine.

When I read comments that some people who want DirectX in this or that console it make me want to tear the little hair I have left out of my head. And it is apparent that these people have no idea of what  DirectX is and what it does.

First off before I delve into some more semi-technical aspects of what it does. I will go into what it is. DirectX is a wrapper “language” that helps developers make graphic intensive programs for the WINDOWS platform. (aka anything that runs Windows in some form) So right there you can rule out DirectX ever being used for any Sony or Nintendo product, these companies make their own proprietary OS for their systems.

Now what is a wrapper programming language and what does it do for programmers. On a programming aspect you can view a computer system that runs windows as a building with many different stories. It runs from Machine level (dealing with custom programming each and every single piece of hardware in a computer to do what you want it to) to the various API layers of Windows.

Windows is a system comprised of many layers that separates programs from the hardware layer. This helps in that you can use the generic virtual drives that Windows provides so you do not have to worry about optimizing your code to run on a specific device. The down side to it is that sometimes the layers have trouble communicating with each other and trigger the Blue Screen of Death.

What DirectX does is add another layer to this and deals with communicating with these generic drivers and messaging systems so the programmer and concentrate one make their program. This gives developers a easy entrance into programming for Windows, the down side is you sacrifice power and optimization (and in some part stability) for ease.

So DirectX in console is basically a step that allows programmers the ability to quickly make code for the Xbox. But as time goes by the DirectX portions of the engines get replaced in favor of machine code that allows the engine to run faster take up less RAM and do amazing things that just are not possible with DirectX. They may still use DirectX for items such as I/O functions since these tend to be closer to the machine level, and are optimized fairly well. (No need to reinvent the wheel.)

Nintendo and Sony do use a wrapper language for their systems, it comes in the form of the open source OpenGL/AL formats since these do not need to talk to the Windows API layers, which allows easier porting to various other platforms. (Though the OpenGL/AL in these are optimized and trimmed down for use with the systems it is intended for.)

Well that is all I can say for now. I was working on this for a book I'm writting to try and combat my major student loan issues. So I'm gathering what I learned about game development and presenting it for those who want to use it as a hobby and do it as inexpensivly as possible. (Unlike me who got taken by a "private technical collage" who took all my financing and now the creditor want their money...)



Around the Network

I thought DX11 was general enough now that direct code wasn't used any more? All calls from major games go through the DX driver on Windows as far as I know. Also it might sound attractive to bypass that extra 'layer' but really you will not see speed gains from direct access, it's too hard to do for complex game engines.

DX is actually fine to implement on non-MS platforms, since hardware support is there, all they need to do is write new libraries for it instead of using MS's code.



Machine code is still used since it makes game code stable. (A good analogy is a foundation the deeper you make it (within reason) the more stable the building is.) You can program completly using a C language/DirectX and it will preform rather decently in small games. But the more complex the program (especially high end games) you want to have machine code. Especially in the area of memory management. As you stated DirectX is a generalized code so it handles everything in a generic homogenous way, which isn't always the best way to do things. Hence all high end engines (Unreal, Crytech's engine, etc) use machine code in this way.



Not sure why on earth I read that, as I didn't really care in the first place.

However good luck with your book, hopefully it'll be successful enough to combat the student loan.



Disconnect and self destruct, one bullet a time.

What you're saying is not entirely correct or incorrect ...

Both OpenGL and Direct3D are graphical APIs that act as a hardware abstraction layer for rendering 3D graphics (most often) in real time. Their primary use is to provide a uniform way for software developers to produce 3D graphics regardless of which graphics hardware they have. Being that both of these APIs work in essentially the same way (some would argue because Microsoft copied OpenGL because they didn't want to use open standards), and the code required to interface with either API is relatively small, many graphics engines are designed to use either API to increase the viability of the engine for cross-platform use.

DirectX also contains a bunch of other libraries to manage many other areas of game development, but the last statistics I saw indicated these libraries were far less popular than their open source cross-platform equivalents; but that may have changed.



Around the Network

Well I figured as much so, were they not going to call the original xbox DIrectXbox or something .

Good luck with your book!



 

Seece said:
Well I figured as much so, were they not going to call the original xbox DirectXbox or something .

Good luck with your book!


Yup.

OT:

Good luck with your book.



What HappySquirrel is saying is correct.

I'm not sure saying DirectX is a wrapper language is correct at all. DirectX isn't even a language. It's just a collection of APIs.

Also assembly language is only really used on consoles for smaller high-frequency functions where a noticeable performance gain will be possible, or for things where no API call might exist (old school eg: enabling a vblank interrupt). I seriously doubt that any assembly is done on PCs anymore.

As for DX appearing on non-MS platforms... the API structure could easily be used on any other platform. It's just a matter of licensing and the fact that OpenGL has been an open standard for so long already that it is sufficient for developers on non-MS platforms..



_mevildan said:
 I seriously doubt that any assembly is done on PCs anymore.

Not in graphics it isn't, because there's probably 10 post-2005 distinct architectures you'd have to target, say Nvidia G70, G80, GT200; AMD R500, R600, Evergreen, GCN; Intel Atom, Intel pre-Westmere and Intel post-Westmere. Using the DirectX or OpenGL driver abstracts those differences but I seriously doubt they are binary compatible at the assembly level.



Calling DirectX a programming language is definitely wrong.