游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2999|回复: 2

DirectX特效 Chapter2第六???例修改

[复制链接]

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
发表于 2005-7-16 20:40:00 | 显示全部楼层 |阅读模式
//DirectX特效 Chapter2第六???例
//修改後(凡是修改?都???fdef akira_test_),希望按下一???(by WM_KEYDOWN)就??嗬L?一???色方形(tt.bmp)在原?

???:?我按下任意?後,?K不??霈F?色的方?K在原?,而是要我?⒁?窗移出?幕外後在移回??才??⑿??K?出?色的方?K.
可是我在WM_KEYDOWN?r,有送出WM_PAINT,而且的?也有收到此command,就是不???出?色方?K.
?大家?臀铱匆幌率鞘颤N原因.

附上:source code

void PaintWindow(HDC hdc)
{
// set our mapping mode as text. this means 1 logical unit = 1 pixel.
SetMapMode(hdc, MM_TEXT);

// this function will draw the bitmap without stretching.
/*BitBlt(hdc,
0, 0, g_iScreenWidth, g_iScreenHeight,
g_hDCBitmap, 0, 0, SRCCOPY);
*/

// this function will stretch the bitmap so that it fits in the window.
StretchBlt(hdc,
0, 0, g_iScreenWidth, g_iScreenHeight,
g_hDCBitmap, 0, 0, g_iBitmapWidth, g_iBitmapHeight, SRCCOPY);

#ifdef _akira_test_

//?一???色方形
if (g_bDrawGreenSquare)
DrawOneBitmap(hdc);

#endif//_akira_test_
}

LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
)
{
switch(uMsg) {

#ifdef _akira_test_
case WM_KEYDOWN:
{
g_bDrawGreenSquare=true;
SendMessage(hwnd,WM_PAINT,0,0);
}
break;
#endif//_akira_test_

case WM_PAINT:
{
PAINTSTRUCT ps;

// get the DC we're supposed to use from Windows
BeginPaint(hwnd, &ps);
HDC hdc = ps.hdc;

// paint our window (function is defined above)
PaintWindow(hdc);

// tell Windows we're done painting.
EndPaint(hwnd, &ps);

TRACE(">>>>OnPaint\n");
}
// we processed the message, so return 0.
return(0);

sf_2005716204021.zip

31.09 KB, 下载次数:

42

主题

418

帖子

418

积分

中级会员

Rank: 3Rank: 3

积分
418
发表于 2005-7-17 14:30:00 | 显示全部楼层

Re:DirectX特效 Chapter2第六???例修改

代码太长了,看得眼花。
没有见过“DirectX特效 Chapter2第六???例”,不好回答你的问题

4

主题

30

帖子

41

积分

注册会员

Rank: 2

积分
41
QQ
发表于 2005-7-31 19:37:00 | 显示全部楼层

Re:DirectX特效 Chapter2第六???例修改

什么东西?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-12-26 16:43

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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