|
最近用DX写了一个程序,最初DirectX设置的是Retail模式,程序能够正常运行;可是当我将DirectX设置为Debug模式时程序就不能运行了,在如下位置产生了中断,但出现的不是黄色的中断箭头,是绿色的箭头
void CInit::Render(float timeDelta)
{
...
g_pD3DDevice-> resent(NULL, NULL, NULL, NULL); //产生中断的语句,指针g_pD3DDevice此时并没有释放
}
提示信息为
XXX.exe 中的 0x5b38dfbf 处未处理的异常: 0xC0000005: 读取位置 0x00000188 时发生访问冲突
堆栈调用情况为
XXX.exe!CInit::Render(float timeDelta=0.00000000) 行476 + 0x1e 字节
XXX.exe!WinMain(HINSTANCE__ * hInstance=0x00e80000, HINSTANCE__ * __formal=0x00000000, HINSTANCE__ * __formal=0x00000000, HINSTANCE__ * __formal=0x00000000) 行903
XXX.exe!__tmainCRTStartup() 行263 + 0x2c 字节
XXX.exe!WinMainCRTStartup() 行182
Render()函数的调用位置是在主函数的如下位置
while (msg.message != WM_QUIT)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
float currTime = (float)timeGetTime();
static float lastTime = currTime;
float timeDelta = (currTime - lastTime) * 0.001f;
Initialize.Render(timeDelta);
lastTime = currTime;
}
}
请问各位大虾这个问题该怎么解决?
PS:我用的是DX9.0c,平台VS2008 |
|