如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
C++源代码游戏编程--WinMain()函数集C++源代码游戏编程--WinMain()函数交流//******************************************************************//函数:WinMain()//功能:应用程序入口//******************************************************************intPASCALWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPSTRlpCmdLine,intnCmdShow){MSGmsg;hInst=hInstance;//初始化主窗口if(!InitWindow(hInstance,nCmdShow))returnFALSE;//初始化DirectDraw环境if(!InitDDraw()){MessageBox(hWndMain,"初始化DirectDraw过程中出错!","Error",MB_OK);FreeObjects();DestroyWindow(hWndMain);returnFALSE;}//进入消息循环while(1){if(PeekMessage(&msg,NULL,0,0,PM_NOREMOVE)){if(!GetMessage(&msg,NULL,0,0))returnmsg.wParam;TranslateMessage(&msg);DispatchMessage(&msg);}elseif(bActive){UpdateFrame();}elseWaitMessage();}returnmsg.wParam;}/////////////////////////////////////////////////-----------------------------------------------------------------------------//Name:WinMain()//Desc:Initialization,messageloop//-----------------------------------------------------------------------------intPASCALWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPSTRlpCmdLine,intnCmdShow){MSGmsg;if(InitApp(hInstance,nCmdShow)!=DD_OK)returnFALSE;while(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);}returnmsg.wParam;}///////////////////////////////////////////////////////////////////////////////////////////////主循环/////////////////////////////////////////////////////////////////////////////////////////////intPASCALWinMain(HINSTANCEhInst,HINSTANCEhPrevInst,LPSTRlpCmdLine,intnCmdShow){MSGmsg;if(!InitApp(hInst,nCmdShow))returnFALSE;while(1){if(PeekMessage(&msg,NULL,0,0,PM_NOREMOVE)){if(!GetMessage(&msg,NULL,0,0))returnmsg.wParam;TranslateMessage(&msg);DispatchMessage(&msg);}elseif(bActive){Update();//翻转上一层缓冲区内容到屏幕。Screen->Flip();}elseWaitMessage();}}///////////////////////////////////////////////////////////////////////////////////////////////////intPASCALWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPSTRlpCmdLine,intnCmdShow){//anywindowsprogrammershouldbefamiliarwith