游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2899|回复: 3

大家帮忙来纠错:GetClientRect Failed ?

[复制链接]

48

主题

142

帖子

142

积分

注册会员

Rank: 2

积分
142
发表于 2006-9-16 09:11:00 | 显示全部楼层 |阅读模式
......
D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO
Direct3D9: (INFO) :======================= Hal SWVP device selected

Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present
......

48

主题

142

帖子

142

积分

注册会员

Rank: 2

积分
142
 楼主| 发表于 2006-9-16 14:36:00 | 显示全部楼层

Re:大家帮忙来纠错:GetClientRect Failed ?

采用逐语句调试,当箭头指向ZeroMemory( &d3dpp, sizeof(d3dpp) );
输出D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO
当箭头指向 g_pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
输出Direct3D9: (INFO) :======================= Hal SWVP device selected
当点击窗口右上方关闭按钮时输出:
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present
...
网上搜索的结果:是消息处理流程上的问题。先把窗口破坏了然后才中止绘图线程。我的程序中没有用GetClientRect,可能是Windows或者DirectX的函数中有调用它的。在发生错的时候,从VC的调用堆栈当中找,看是那个dx的函数调用的

7

主题

438

帖子

438

积分

中级会员

Rank: 3Rank: 3

积分
438
发表于 2006-9-19 13:44:00 | 显示全部楼层

Re:大家帮忙来纠错:GetClientRect Failed ?

楼上不要乱搞笑了,没写过d3d程序?

d3dpp当然是present parameters结构咯。

7

主题

438

帖子

438

积分

中级会员

Rank: 3Rank: 3

积分
438
发表于 2006-9-19 13:50:00 | 显示全部楼层

Re:大家帮忙来纠错:GetClientRect Failed ?

楼主,你可以尝试一下在处理WM_QUIT消息时关闭IDirect3DDevice9,IDirect3D这些接口(所谓关闭就是调用release掉所有引用),应该就可以了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-25 11:32

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表