DirectX General Issues

Home | Up | Search | X-Zone News | Services | Book Support | Links | Feedback | Smalltalk MT | The Scrapyard | Technical Articles

 

X-Zone's DirectX FAQ
General Issues

General Issues - Application Installers

Once my application is installed on an end user's system, how can I find out which drive it's CD is in?

General Issues - Compiler

Can I Program for DirectX in Borland C++ ?

When attempting to compile under the DirectX 8 SDK, I recieve a compiler error stating that  DirectInputCreateEx or DirectInputCreate is an undeclared identifier.

After installing the DX 8 SDK, I recieve the error LNK1104: Cannot Open File "d3dim.lib" when attempting o compile my program.

Why doesn't Intellisense offer code completion options for DX 8 interfaces under VC++?

General Issues - Timing and Motion

How Should I Perform Timing in my Game?

How can I achieve a consistent rate of motion, regardless of the machine my program is executed on?

General Issues - Application Installers

Q. Once my application is installed on an end user's system, how can I find out which drive it's CD is in?

This can be a bit tricky at first, making it hard to insure reliable results.  Basically, you need to properly enumerate all of the drives on the system, and determine which drives are actually CD-ROM drives.  Then you can get the volume labels for the available CDs on the system and compare them to the volume label of the required CD, notifying the user to intervene if there is no match.  To find out more, read this article with source code which includes a disk search routine that can easily be integrated into your existing or projects.

Back to the Top    Back to Main Index

General Issues - Compiler

Q. Can I Program for DirectX in Borland C++ ?

Yes, support for Borland C++ is provided in the DirectX SDK.  To find out more about setting up DirectX support in Borland C++, see Using DirectX In Borland C++ by Mikael Lundberg.

Q. When attempting to compile under the DirectX 8 SDK, I recieve a compiler error stating that  DirectInputCreateEx or DirectInputCreate is an undeclared identifier.

Compiling code for previous versions of DirectInput under DirectX 8, you must define a constant specifying the required version support prior to including dinput.h.  Define DIRECTINPUT_VERSION to be equal to 0x300, 0x0500, or 0x0700, like this:

#define DIRECTINPUT_VERSION 0x0700
#include <dinput.h>

Back to the Top    Back to Main Index

General Issues - Timing and Motion

Q. How Should I Perform Timing in my Game?

Overall, you will want to avoid the use of timer callbacks, because of the latency inherent to their use of the message queue for notification.  Instead, your best performance will be achieved by overriding the application's message loop and making use of timer functions that poll the system for the current time.  For more information on this subject, see Writing the Game Loop and the associated article Selecting Timer Functions.

Back to the Top    Back to Main Index

Q. How can I achieve a consistent rate of motion, regardless of the machine my program is executed on?

To insure consistent performance, your application must calculate object position on a frame by frame basis, based upon  a measure of elapsed time between frames.  For information on how to implement this, as well as information on applying realistic acceleration and gravity to game titles, read our article on Steady Motion.

Back to the Top    Back to Main Index

This site, created by DirectX MVP Robert Dunlop and aided by the work of other volunteers, provides a free on-line resource for DirectX programmers.

Special thanks to WWW.MVPS.ORG, for providing a permanent home for this site.

Visitors Since 1/1/2000: Hit Counter
Last updated: 07/26/05.