为什么 Direct3DCreate9 会很慢?
我正在尝试稍微加快 Direct3D 应用程序的启动时间,并且我注意到根据探查器,Direct3DCreate9 花费了整整一秒(比其他任何时间都多)。为什么?对此我们能做些什么呢?
操作系统:XP,DirectX:9.0。在具有不同 DirectX 的 Windows 7 上也有相同的行为,而且我注意到许多游戏也受到这种“Direct X 初始化”延迟的影响,所以这不仅仅是我的配置的问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您调用
Direct3DCreate9
时,您正在初始化所有 DirectX 库。这可能需要一段时间。您几乎无法提高此调用的速度。最好的选择通常是在首次初始化 DirectX 时向用户提供一些视觉反馈,告知用户正在加载内容(如果可能)。这至少表明您的应用程序正在做“某事”,而不仅仅是挂起。
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.