64,637
社区成员
发帖
与我相关
我的任务
分享
int Game_Init(void *parms)
{
// this function is where you do all the initialization
// for your game
DDraw_Init(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP);
Load_Bitmap_File(&bitmap16bit,"beginmenu.bmp");
Create_Bitmap(&startmenu,0,0,376,222,16);
Load_Image_Bitmap(&startmenu,&bitmap16bit,0,0,BITMAP_EXTRACT_MODE_ABS);
Unload_Bitmap_File(&bitmap16bit);
// start up DirectDraw (replace the parms as you desire)
return(1);
} // end Game_Init
///////////////////////////////////////////////////////////
int Game_Shutdown(void *parms)
{
return(1);
} // end Game_Shutdown
///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
int Game_Main(void *parms)
{
// this is the workhorse of your game it will be called
// continuously in real-time this is like main() in C
// all the calls for you game go here!
Start_Clock();
DDraw_Fill_Surface(lpddsback, 0);
DDraw_Lock_Back_Surface();
Draw_Bitmap16(&startmenu, back_buffer, back_lpitch, 0);
DDraw_Unlock_Back_Surface();
DDraw_Flip();
// check of user is trying to exit
if (KEY_DOWN(VK_ESCAPE))
PostMessage(main_window_handle, WM_DESTROY,0,0);
// sync to 30ish fps
Wait_Clock(30);
// return success
return(1);
} // end Game_Main
//////////////////////////////////////////////////////////