游戏流程
来源:互联网 发布:河南预约挂号软件 编辑:程序博客网 时间:2024/03/29 01:36
int WINAPI WinMain( HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
WNDCLASSEX winclass; // this will hold the class we create
HWND hwnd; // generic window handle
MSG msg; // generic message
HDC hdc; // graphics device context
// first fill in the window class stucture
winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_DBLCLKS | CS_OWNDC |
CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc = WindowProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;
winclass.hInstance = hinstance;
winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName = NULL;
winclass.lpszClassName = WINDOW_CLASS_NAME;
winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
// save hinstance in global
hinstance_app = hinstance;
// register the window class
if (!RegisterClassEx(&winclass))
return(0);
// create the window
if (!(hwnd = CreateWindowEx(NULL, // extended style
WINDOW_CLASS_NAME, // class
"DirectDraw 16-Bit Full-Screen Demo", // title
WS_POPUP | WS_VISIBLE,
0,0, // initial x,y
SCREEN_WIDTH,SCREEN_HEIGHT, // initial width, height
NULL, // handle to parent
NULL, // handle to menu
hinstance,// instance of this application
NULL))) // extra creation parms
return(0);
// save main window handle
main_window_handle = hwnd;
// initialize game here
Game_Init();
// enter main event loop
while(TRUE)
{
// test if there is a message in queue, if so get it
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if (msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
} // end if
// main game processing goes here
Game_Main();
} // end while
// closedown game here
Game_Shutdown();
// return to Windows like this
return(msg.wParam);
} // end WinMain
- 游戏流程
- 游戏制作简单流程
- 游戏开发流程
- 游戏登陆流程 .
- 游戏登陆流程
- cocos2dx游戏循环流程
- 游戏开发标准流程
- 游戏开发流程
- c++游戏开发流程
- 游戏开发制作流程
- 游戏服务登录流程
- 游戏登录流程
- 水果机游戏开发流程
- 游戏制作流程整理
- 联运游戏-支付流程
- 游戏制作流程思考
- 游戏开发流程
- ios游戏发布流程
- 一边睡觉一边洗澡
- 如何让datawindow控件无法得到焦点!!
- 学习笔记,VB.NET使用DirectSound9 (2) 声音的特性
- 在Windows2000上安装SSH/CVS/SVN/ViewCVS
- 失恋时十大必听歌曲
- 游戏流程
- 初始化(16位)
- 天堂......光良
- 好想念她
- 10大自我修炼工具
- 总结一下这阶段(2004.5~2004.10)的工作(项目神话)
- 新的一年
- 程序员的七种武器
- 解读《普通大学应届毕业生如何成功应聘微软》