Platform SDK: DirectX |
This topic pertains only to application development in C++. See Direct3D Immediate Mode Visual Basic Samples.
This sample shows how to load and render .x files.
Source: (SDK root)\Samples\Multimedia\D3dim\Src\XFile
Executable: (SDK root)\Samples\Multimedia\D3dim\Bin\XFile.exe
When you run the sample, an Open File dialog box appears. You can find some .x files in the media folder of the D3DIM samples directory. If there is a .bmp file of the same name in the directory, it is automatically used as a texture for the object.
Press F1 to see available commands. In addition, you can load a different file from the File menu.
If a texture appears upside-down on an object that you have loaded, it is because of the way the object loads the texture. An earlier version of Direct3D loaded bitmaps upside-down, so the creators of some .x files compensated by reversing the coordinates.