|
|
发表于 2008-6-11 08:54:00
|
显示全部楼层
Re:各位请问如何自己写OnLostDevice?是否有好方法?
function CheckDxDevState: HResult;
begin
Result := E_FAIL;
if mD3dDev = nil then exit;
if mDevLost then
begin
Result := mD3dDev.TestCooperativeLevel;
if Result = D3DERR_DEVICENOTRESET then
begin
OnLostDevice;
if Succeeded(mD3dDev.Reset(mD3dpp)) then
begin
OnRestDevice;
mDevLost := false;
Result := S_OK;
end;
end;
end;
end;
这是Delphi的简化代码,只要看懂思路就可以了. 用自己的函数代替OnLostDevice和OnRestDevice. |
|