ATTENTION READERS! Lucky's VB Gaming Site is no longer active. For updated game programming information and tutorials, please visit The Game Programming Wiki!
What is DirectX?
So what is this wonderful DirectX thing that game programmers are always going on
about? Basically, it is MicroSoft's answer to game programmer's complaints that
windows is a poor platform for game development. You see, in the old days, the
only thing that game programmers had to create games with in windows was the API.
Anyone who's ever tried using the API BitBlt function to make a quality game
can tell you that it is far too slow!
Enter DirectX. DirectX is a collection of DLLs that contain functions useful
to game programmers, and best of all, these functions are almost entirely platform
independent. In other words, DirectX allows programmers access to fast graphics,
sound, and input functions while shielding them from having to test for the capabilities
of the computer on which their program is running. DirectX will assay these capabilities
for you, and even if they are not present, they may be (in many cases) emulated for you. You
barely even have to think!
Well, Lucky likes the sound of that! Thinking equals Work, and Work had better equal Money
or Lucky's not gonna do it! Ok, it's still a fair amount of work programming a game,
but a lot less thanks to dX.
The recent release of dX7 has given Visual Basic programmers powers to rival those of
C++ programmers. You see, now dX comes with it's own Visual Basic Type Libraries. A type
library describes the functions contained within a DLL or group of DLLs, thereby allowing
a programmer to access the capabilities contained within the DLLs. Before DirectX 7.0, we
had to rely on type libraries created by a man named
Patrice Scribe. These type libraries certainly did the job (and well) but dX7 has the added
boon of coming with documentation and sample programs. Now there are many resources a budding
VB DirectX game programmer can draw upon.
The DirectX tutorials provided here all rely on DirectX 7.0. You'll have to go to the
Microsoft's DirectX Page and download
the SDK (122megs) if you wish to follow along. The tutorials on bitmaps, transparency, animation,
and zooming to follow will all be explained in a single example project that you can download
here.