Home Up Articles Tutorials Downloads Web Links Newsgroups About Me Search

Direct3D FAQ

Q: How are 2D games created now?
A: DirectDraw is no longer supported in DX8 and beyond. Microsoft merged both DirectDraw and Direct3D into one component called "DirectX Graphics". Either continue to use DirectDraw 7 or use the newer 3D interfaces. If you use Direct3D, the target computer will need to have a good 3d card to get good frame rates. Using Direct3D for your 2D graphics allows for hardware-accelerated rotation, scaling, etc. Besides, it's easier on Microsoft to only have to manage one set of APIs. You might want to check out www.gamedev.net - they put up an article on using 2D with Direct3D.

Q: How do you determine the total memory a card has, excluding AGP memory?
A: Direct3DDevice8.GetAvailableTextureMem returns the total available memory, including AGP. Allocating resources based on an assumption of how much video memory you have is not a great idea. What if the card is able to compress the textures? There might be more space available than you might have thought. You should create resources and check for out of memory errors, then scale back on the textures. For example, you could remove the top mip levels of your textures.

Q: How do I make my Direct3D application toggle from fullscreen to a window?
A: Almost all of the SDK samples show you how to do this, see what they are doing differently than in your app.

Q: D3DX8.Intersect was changed in DX8.1, what is the countHits parameter that was added?
A: This was a last minute change to the D3DX library that did not make it into the VB docs. However, the Intersect method does seem to work correctly. Simply create a Long (VB6) variable and pass it into the last parameter of the method. The number of intersections will be returned.

"If we knew what it was we were doing, it would not be called research, would it?"
- Albert Einstein

2009 Eric DeBrosse


Hit Counter
Visitors since 5/21/2002