全屏模式下设备丢失的问题
时间:2011-11-13
来源:互联网
有这么几个函数C/C++ code
C/C++ code
检查设备丢失C/C++ code
我用debug配置的时候运行正常...换成release后就会崩溃...地址在d3dx9_43.dll中..有高人能知道原因么.......
QFAPI void D3D9FrameRender(HWND hWnd,FLOAT fTimeDelta,int state); QFAPI void D3D9FrameCleanup(); QFAPI void LoadingResource(); void static OnLostDevice( void ); void static OnResetDevice( void ); void static InitDevice(void);
C/C++ code
void QFDeviceManager9::OnLostDevice( void ) { g_pSprite -> OnLostDevice(); g_pTextFPS -> OnLostDevice(); g_pTextnihao -> OnLostDevice(); } void QFDeviceManager9::OnResetDevice( void ) { if (FAILED(g_pd3dDevice->Reset( & d3dpp))) { return ; } g_pSprite -> OnResetDevice(); g_pTextFPS -> OnResetDevice(); g_pTextnihao -> OnResetDevice(); InitDevice(); } void QFDeviceManager9::InitDevice(void) { //设置光照 g_pd3dDevice->SetRenderState(D3DRS_LIGHTING, false); g_pd3dDevice->SetRenderState(D3DRS_AMBIENT, D3DXCOLOR(0.4f, 0.4f, 0.4f, 1.0f)); // 设置虚拟摄像机 g_pCamera = new CCamera(g_pd3dDevice); g_pCamera->ResetCameraPos(&D3DXVECTOR3(0.0f, 30.0f, -100.0f)); g_pCamera->ResetViewMatrix(); D3DXMATRIX matProj; D3DXMatrixPerspectiveFovLH(&matProj, D3DX_PI / 4.0f, 1.0f, 1.0f, 2000.0f); g_pCamera->ResetProjMatrix(&matProj); }
检查设备丢失C/C++ code
hr = g_pd3dDevice-> Present(NULL, NULL, NULL, NULL); if (hr == D3DERR_DEVICELOST) { if (g_pd3dDevice-> TestCooperativeLevel() == D3DERR_DEVICENOTRESET) { OnLostDevice(); OnResetDevice(); }
我用debug配置的时候运行正常...换成release后就会崩溃...地址在d3dx9_43.dll中..有高人能知道原因么.......
作者: lalalaring 发布时间: 2011-11-13
写的不错,谢谢
作者: bigporker 发布时间: 2011-11-13
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28