Direct3D 奇怪的崩溃
我有用VS2008编译的Direct3D渲染库。另一个应用程序(用 VS2008 构建)使用我的库,一切正常。
最近,父应用程序已移至 VS2010,但我的库仍在 VS2008 下构建。一切仍然正常,但一次调用只能调用一个精灵。
D3DXSprite->Draw 方法在 D3DXCore::CSprite::Draw() 方法中的 D3DX9_43.dll 中崩溃。仅当我尝试从纹理中绘制特定元素时才会发生这种情况。
我也尝试过在VS2010下重建我的库,但没有成功。崩溃仍然发生。
有什么想法吗?
谢谢!
I have Direct3D rendering library compiled with VS2008. The another application (built with VS2008) uses my library and everything works fine.
Recently, parent application was moved to VS2010 but my library is still being built under VS2008. And still everything works fine BUT one call on only ONE sprite.
D3DXSprite->Draw method crashes in D3DX9_43.dll in D3DXCore::CSprite::Draw() method. And it occurs only when I'm trying to draw a specific element from texture.
I've also tried to rebuild my library under VS2010, but no success. Crash still occurs.
Any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能不是您想听到的,但我对调试此类内容所能建议的就是自由使用断点和特殊的调试 if 语句。
在失败的渲染函数周围放置一条 try-catch 语句,并在 catch 块中放置一个断点。
您可能需要添加一些计数器和调试变量,以便可以监视数据结构的大小/连续性与渲染代码实际处理的内容。
如果您仍然没有任何提示,那么是时候暂时分叉您的代码(复制它)并简化了。开始删除代码块,看看它是否仍然失败。最终你会缩小范围。
祝你好运。
This may not be want you want to hear, but all I can suggest for debugging something like this is the liberal use of break points and special debugging if-statements.
Place a try-catch statement around the render function that is failing and place a breakpoint in the catch block.
You may need to add some counters and debugging variables so that you can monitor the size/cont of your data structures vs. what your rendering code actually processed.
If you still don't have any hints, it's time to temporarily fork your code (copy it) and simplify. Start ripping out chunks of code to see if it still fails. Eventually you'll narrow it down.
Good luck.