#include<windows.h>
#include<windowsx.h>
#include<stdio.h>
#include<math.h>

#define WINDOW_CLASS_NAME "WINCLASS1"

LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARARM wparam,LPARAM lparam)
{
PAINTSTRUCT ps;
HDC hdc;
switch(msg)
{
case WM_CREATE:
{
//INIT CODE
return(0);
} break;
case WM_PATIN:
{
hdc=BeginPaint(hwnd,&ps);
EndPaint(hwnd,&ps);
return(0);

} break;

case WM_DESTROY:
{
PostQuitMessage(0);
return(0);

}break;
default:break;

} //end WinProc


}


int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline,int ncmdshow)
{

//首先是进行游戏初始化在开始
Game_Init();
WNDCLASSEX winclass;
HWND hwnd;
MSG msg;

winclass.cbsize=sizeof();
winclass.stylee=..;


//register window class
if(!(hwnd=CreateWindowEx(NULL,WINDOW_CLASS_NAME,"","",....);
return(0);

//进入主循环
while(GetMessage(&msg,NULL,0,0))
{

TranslateMessage(&msg);
DispatchMessage(&msg);
//在此处进行游戏逻辑循环
Game_Main();

}
return (msg.wParam);

Game_ShutDown();
游戏关闭
}

 

 

 

 

 

 

 

 

 

 

 

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2021-04-14
  • 2021-08-06
  • 2021-12-30
  • 2022-12-23
  • 2021-12-03
  • 2021-08-20
猜你喜欢
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-05-07
相关资源
相似解决方案