Why can Direct3DCreate9 be slow?
I'm trying to speed up the start times for my Direct3D app a bit, and I have noticed Direct3DCreate9 takes a whole second according to profiler (more than anything else). Why? And what can be done about it?
OS: XP, DirectX: 9.0. Same behaviour on Windows 7 with different DirectX, and I have noticed many games suffer from开发者_如何转开发 this "Direct X initialization" lag too, so it's not like it's a problem with just my configuration.
When you call Direct3DCreate9
you're initializing all of the DirectX libraries. This can take a while.
There is little you can do to improve the speed of this call. The best option is to usually provide some visual feedback to the user that things are loading, if possible, while you first initialize DirectX. This, at least, shows that your application is doing "something" and not just hung.
精彩评论