1.0:FAQ

From DXFWiki

Jump to: navigation, search

Contents

General

The program complains about a missing DirectX DLL.

Games compiled in the "Debug" configuration may not run outside of the computer they were developed on.

Rebuild your game in the "Release" configuration.

  • Build -> Configuration manager -> Active solution configuration

The program still complains about a missing DirectX DLL.

Due to the monthly updates, the computer you are running DXFramework on must have the latest DirectX runtime update:

What kinds of image file types are acceptable?

The following formats have been tested, other formats may be possible:

  • JPEG
  • PNG
  • BMP

What kinds of music or sound effects are acceptable?

The following formats have been tested:

  • mp3 (use dxf::Music)
  • midi (use dxf::Music)
  • wav (use dxf::Sound)

A good, free sound editor: Audacity

Programming Issues

Can I use C++ Exceptions?

Exceptions are turned off for performance reasons. You may re-enable them, at your own risk, in the project properties.

I'm getting many compile-time DirectX errors.

Make sure Visual Studio is configured properly.

What about different screen resolutions?

This is a very difficult topic. The simple answer is to pick 800x600 or 1024x768 for simple 2D games. See dxf::Game::Load()

Can I go full-screen?

Yes, ALT-Enter to toggle on the fly. To start full-screen, see the function prototype for dxf::Game::Load()

How do I exit the program?

Call PostQuitMessage(0) anywhere. Change 0 to your favorite exit code if you want.

How do I shut off the mouse cursor?

There does not seem to be an easy reliable way to do this in windowed mode, leave it on if possible.

If you need to disable the mouse in windowed mode Google around for a solution. Be very careful and make sure that it is easy and intuitive to restore the mouse or you will likely agitate your users.

If you would like to control the cursor in full screen mode, use this function:

void    DXUTSetCursorSettings( bool bShowCursorWhenFullScreen, bool bClipCursorWhenFullScreen );

It is defined in DXUT.h. Call that function in the state's Load() function and remember that the setting will persist across state changes.

How do I play MP3 files?

Use the dxf::Music class (not dxf::Sound)

What are precompiled headers?

The DXUT and engine components use precompiled headers to increase compile time. Long story short, every file includes the same header file (such as dxstdafx.h or dxframework.h) and some special settings precompile this code to minimize rebuild times. This is best for code that doesn't change often. A simple search for precompiled headers reveals a lot more information on the topic.

Although the engine and dxut components use precompiled headers, the other components do not by default in an attempt to not confuse those unfamiliar with the topic. Feel free to use them if you are comfortable.

I get an include error in my .rc file using Visual C++ Express

If you are getting an error similar to this and are using Visual C++ Express:

.\demo.rc(10) : fatal error RC1015: cannot open include file 'winres.h'.

This is caused because Express does not ship with the files required for resources. The workaround is described here.

Visual Studio

When I hit F5 to debug, I get a weird dialog, "Executable for Debug Session"

You likely have the dxf-engine or dxut project selected as your "startup project". Right click on a different project (like dxpong or your game's project) and select "Set as Start Up Project".

Bugs

I found a bug!

Report bugs here please:

Personal tools