谢天谢地 总算可以问问题了

ga6840 2008-08-19 09:11:30


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
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);
hinstance_app = hinstance;
if (!RegisterClassEx(&winclass))
return(0);
if (!(hwnd = CreateWindowEx(NULL,WINDOW_CLASS_NAME,"FLYsh_game",WS_POPUP|WS_VISIBLE,0,0,SCREEN_WIDTH,SCREEN_HEIGHT,NULL,NULL,hinstance,NULL)))
return(0);////////////////////////////////////////// ^----FLYsh_game(′°?úname)
main_window_handle = hwnd;// save main window handle
FLYsh mygame1(main_window_handle);
mygame1.FLYsh_Init();// initialize game here (ó??·è??ú1)
while(TRUE)
{if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
if (msg.message == WM_QUIT)
{break;}
TranslateMessage(&msg);
DispatchMessage(&msg);
} // end if
mygame1.FLYsh_Main(); // main game processing goes here (ó??·è??ú2)
} // end while
mygame1.FLYsh_Shutdown();// closedown game here (ó??·è??ú3)
return(msg.wParam);
} // end WinMain
/////////////////////////////////////WindowProc///////////////////////////////////////////////////
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
省略~
} // end WinProc
/////////////////////////////////////////////A . I/////////////////////////////////////////////////
void FLYsh::FLYsh_onEnterFrame()
{




static bool is_firs_run=true;


//FLYsh_rectangle(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,255,255,255);


if(is_firs_run)
{
for (int j=0;j<100;j++)
{
FLYsh_plot(156,200,70,500+j,500+j);
}
FLYsh_load_bitmap();


is_firs_run=false;
}

if (KEYDOWN(VK_ESCAPE)){
should_close_all=true;
}
}


~~~完啦 呵呵~~
这是win32平台
要包括ddraw.lib dxguid.lib dinput.lib dinput8.lib winmm.lib
实在是上传有问题 迫不得已啊 版主原谅

各位辛苦了
...全文
77 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ga6840 2008-08-20
  • 打赏
  • 举报
回复
希望大家多多帮助 最后一个问题争得困扰我好久阿
谢谢啦
ga6840 2008-08-20
  • 打赏
  • 举报
回复
回luoxi1124 怎么会是用c写的呢??
只用了命名空间和 fstream 来读位图 标准的c++阿
qqwx_1986 2008-08-19
  • 打赏
  • 举报
回复
散分贴吗 呵呵
luoxi1124 2008-08-19
  • 打赏
  • 举报
回复
经确认,是用C写的。
freshui 2008-08-19
  • 打赏
  • 举报
回复
你的问题呢?
lzr4304061988012 2008-08-19
  • 打赏
  • 举报
回复
???????????????????

33,311

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧