Saturday, July 5, 2014

DirectX SDK

Now I'm reading a book Beginning .NET Game Programming in C# [11]. It talks about using the technologies of GDI+ and DirectX. GDI+ is used for 2D, and DirectX for 3D. The book was published in 2004, so it uses VS.NET 2003 and DirectX SDK 9. The book is easy to read, so I was able to quickly skim through in 3 hours. It seems to be clearly written, with 7 chapters and several example games. At the end there is a bonus chapter on porting a game, .Nettrix, to Picket PC. Appendix A gives a list of recommended game programming books for interested readers. Appendices B, C and D are experiences and suggestions on how to make good, successful games by veteran developers.

For a brief idea on the comparison of GDI and DirectX, see [2][3].

DirectX is Microsoft's technology on high performance graphics application development.

The most recent version is DirectX SDK v9.29.1962 released on 06/07/2010, and can be downloaded here [9]. It works on windows XP and above. If you just want the DirectX End-User Runtime, you can download here [10].

Since Windows 8, the DirectX SDK is combined into Windows SDK [1]. If you have VS.NET 2012 installed, it should include it.


== DirectX development in VirtualBox XP ==

Microsoft's Tutorial on DirectX programming is at [4][5] (note tutorial in [4] is on C#, but the SDK downloaded form [9] contains only C++ examples).  I got error "D3DERR_NOTAVAILABLE" when running example programs (from the book [11]) on XP in mac VirtualBox. Don't know this is a limitation of the mac hardware or of the VirtualBox environment. After following the diagnosing procedure in [6] (basically using the dxdiag console command), it seems XP in VirtualBox does not support Display support of Direct3D, DirectDraw might be supported by software.  I found [7], and followed it to install Guest Extension in safe mode, and installed Direct3D support (note after this, running video such as in youtube could have mosaic effect initially, use dxdiag to disable/enable DirectX support, and reboot, the problem then is gone).  After this, when running dxdiag again I got this error in [8], test passes for DirectX 8 and 9, but not 7, which seems to be expected behavior.  The tutorial program can run properly.  For the gaming book examples, some still reports openGL warnings as in the screenshot below (Figure 1). However, the games can run! And some of these are cool games with realistic 3D video and wave sound, such as Space donuts (Figure 2) and Spacewar 3D (Figure 3).

Conclusion is I should be able to do Direct X development in VirutalBox XP :)


Figure 1. OpenGL warnings

Figure 2. Game: Space Donuts

Figure 3. Game: Spacewar 3D


References:

No comments:

Blog Archive

Followers