directdraw中的问题,背景SURFACE使用blt出现错误

gohan 2008-07-21 04:25:26
我看的是那本windows编程大师技巧,他的demo7_8中,执行到blt的函数就没有了响应,是不是调用方法不太兼容比较新的dx
我用的是vista sp1 +vs2008+dx9.0 sdk

DDBLTFX ddbltfx; // the blitter fx structure
// use the blitter to erase the back buffer
// first initialize the DDBLTFX structure
DDRAW_INIT_STRUCT(ddbltfx);

// now set the color word info to the color we desire
ddbltfx.dwFillColor = 0;

// make the blitter call
if (FAILED(lpddsback->Blt(NULL, // pointer to dest RECT, NULL for whole thing
NULL, // pointer to source surface
NULL, // pointer to source RECT
DDBLT_COLORFILL | DDBLT_WAIT,
// do a color fill and wait if you have to
&ddbltfx))) // pointer to DDBLTFX holding info
return(0);
...全文
180 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
oNiGuang2012 2012-08-05
  • 打赏
  • 举报
回复
我也遇到了同样的问题,但后来自己摸索着解决了
注意到了吗?在demo7_8中宏定义部分
#define SCREEN_WIDTH 320 // size of screen
#define SCREEN_HEIGHT 240
将其改成
#define SCREEN_WIDTH 640 // size of screen
#define SCREEN_HEIGHT 480
因为你的电脑根本就不支持前者,所以会出错
gohan 2008-07-22
  • 打赏
  • 举报
回复
啊。。不是吧,但是这样写出来的东西在dx9runtime下也会出错了?
AliasKavin 2008-07-21
  • 打赏
  • 举报
回复
想用DDraw还是链接DX8SDK吧~~~

8,303

社区成员

发帖
与我相关
我的任务
社区描述
游戏开发相关内容讨论专区
社区管理员
  • 游戏开发
  • 呆呆敲代码的小Y
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧