- 注册时间
- 2004-12-11
- 最后登录
- 2009-7-29
②入门
- 积分
- 39
|
在MFC中可以如此使CDX
BOOL CMainFrame::InitDirectDraw()
{
HWND hWnd = AfxGetMainWnd()->m_hWnd;
Screen = new CDXScreen();
Screen->CreateFullScreen(hWnd,640,480,8);
return TRUE;
}
Then create a timer to handle the flipping of the screen and in the OnTimer method, do the page flipping.
void CMainFrame::OnTimer(UINT nIDEvent)
{
if(Toggle)
{
Screen->Fill(4); // Fill the back buffer red
Toggle = FALSE;
}
else
{
Screen->Fill(1); // Fill the back buffer blue
Toggle = TRUE;
}
Screen->Flip(); // Flip the back buffer to the front
CFrameWnd::OnTimer(nIDEvent);
}
你甚至可以在一个VIEW中使用CDX
CDX强大的2D功能及全面的源代码开放,用来做AVG GAME真是太合适了(尽管CDX的强项是做动作游戏).
而MFC极其简单的CLICK操作方法更加方便开发AVG GAME了.
我也想过是否直接用各种AVG工具软件就可以了呢,但我觉的有一个弱点,就是交互,用工具时交互是极弱的.也不能用数据库. |
|