DirectX explained

View previous topic View next topic Go down

DirectX explained

Post by mr.linkz Tomfoss on Sun Dec 06, 2015 9:57 pm

Ever wondered just what that enigmatic name means?

Gaming and multimedia applications are some of the most satisfying programs you can get for your PC, but
getting them to run properly isn’t always as easy as it could be. First, the PC architecture was never
designed as a gaming platform. Second, the wide-ranging nature of the PC means that one person’s machine
can be different from another. While games consoles all contain the same hardware, PCs don’t: the massive
range of difference can make gaming a headache.


To alleviate as much of the pain as possible, Microsoft needed to introduce a common standard which
all games and multimedia applications could follow – a common interface between the OS and whatever
hardware is installed in the PC, if you like. This common interface is DirectX, something which can
be the source of much confusion.

DirectX is an interface designed to make certain programming tasks much easier, for both the game
developer and the rest of us who just want to sit down and play the latest blockbuster. Before we
can explain what DirectX is and how it works though, we need a little history lesson.

DirectX history
Any game needs to perform certain tasks again and again. It needs to watch for your input from mouse,
joystick or keyboard, and it needs to be able to display screen images and play sounds or music.
That’s pretty much any game at the most simplistic level.

Imagine how incredibly complex this was for programmers developing on the early pre-Windows PC architecture,
then. Each programmer needed to develop their own way of reading the keyboard or detecting whether a joystick
was even attached, let alone being used to play the game. Specific routines were needed even to display the
simplest of images on the screen or play a simple sound.

Essentially, the game programmers were talking directly to your PC’s hardware at a fundamental level.
When Microsoft introduced Windows, it was imperative for the stability and success of the PC platform
that things were made easier for both the developer and the player. After all, who would bother writing
games for a machine when they had to reinvent the wheel every time they began work on a new game? Microsoft’s
idea was simple: stop programmers talking directly to the hardware, and build a common toolkit which they could
use instead. DirectX was born.

How it works
At the most basic level, DirectX is an interface between the hardware in your PC and Windows itself, part of
the Windows API or Application Programming Interface. Let’s look at a practical example. When a game developer
wants to play a sound file, it’s simply a case of using the correct library function. When the game runs, this
calls the DirectX API, which in turn plays the sound file. The developer doesn’t need to know what type of sound
card he’s dealing with, what it’s capable of, or how to talk to it. Microsoft has provided DirectX, and the
sound card manufacturer has provided a DirectX-capable driver. He asks for the sound to be played,
and it is – whichever machine it runs on.

From our point of view as gamers, DirectX also makes things incredibly easy – at least in theory.
You install a new sound card in place of your old one, and it comes with a DirectX driver. Next time
you play your favourite game you can still hear sounds and music, and you haven’t had to make any complex
configuration changes.
Smile

mr.linkz Tomfoss

Posts : 4
Points : 12
Join date : 2015-12-06

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum