Home > Articles > Programming

  • Print
  • + Share This
From the author of

VB and DirectX

VB is starting to show how it can be used with DirectX to create some very acceptable programs, ranging from games to business applications. The following sections take a look at using VB and DirectX.

Interactive Menus

VB is an excellent choice for game menus in today's computer games. Its quick implementation allows for flashy multimedia menus without any complex routines. Most game menus are made up of 2D sprites, text, sound, device input, and background graphics. VB can do all of these functions quite efficiently with DirectX.

Multimedia Applications

Simple multimedia applications are mostly made up of DirectX anyway. Therefore, it doesn't take a degree in computer science to create a shell that launches the library and sends feedback from a graphic of a play button to the DirectX libraries.

Take a look at the VB/DirectX samples in the Microsoft DirectX 8.1 SDK. Notice that there are good samples of audio and video players and editing tools. DirectX does all the hard work for you; all you have to do is create a nice, neat user interface. And VB programmers know that one of VB's specialties is quick UI design.

2D Games

VB and DirectX work well in the creation of 2D shooters, platform games, and D&D adventures. As long as there are not too many sprites on the screen, VB can handle it quite well. There are some excellent examples of 2D games now showing up on the web.

Sound/Audio Effects

In similar fashion to the multimedia applications, DirectX can be used with VB to add incredible sound and audio effects to any VB program. If you want to add a soothing soundtrack to your application, DirectAudio is perfect for this.

Internet Communications

One of the most overlooked features of DirectX is DirectPlay. DirectPlay can be used in many applications for network, Internet, and modem communications. This ability can be very beneficial to VB developers both in the game genre as well as the business community. This very robust communications library is well suited for many uses, including voice communication.

Advantages of VB Over C++

VB offers a few advantages that need to be considered when making the choice of programming languages.

Ease of Use

I've used many languages, including C++, Java, SQL, and PASCAL. And I still have to concede that VB is the simplest programming language for most common Windows applications. I've been able to slap together a simple VB game in DirectX much faster than I can in C++ using the same DirectX libraries. Any VB programmer who understands COM can use DirectX.

No Retraining Necessary

Many developers in the VB community are already extremely familiar with COM objects, and using DirectX is just second nature. The hardest part is understanding multimedia and game programming topics. Once that hurdle is crossed, VB programmers are quickly up and running with DirectX.

Power

For all the complaining by C++ developers over the years, VB has come a long way. The only thing missing is the core features of C++, such as inheritance and polymorphism. Using classes and other features of VB, most programmers have been able to circumvent these limitations. With all the speed increases and latest features of VB 6 and DirectX 8.1, VB is an excellent contender.

  • + Share This
  • 🔖 Save To Your Account