亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? demo12_3.cpp

?? 一本外國人寫的關于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
PAINTSTRUCT	ps;		   // used in WM_PAINT
HDC			hdc;	   // handle to a device context

// what is the message 
switch(msg)
	{	
	case WM_CREATE: 
        {
		// do initialization stuff here


		return(0);
		} break;

    case WM_PAINT:
         {
         // start painting
         hdc = BeginPaint(hwnd,&ps);

         // end painting
         EndPaint(hwnd,&ps);
         return(0);
        } break;


	case WM_DESTROY: 
		{

		// kill the application			
		PostQuitMessage(0);
		return(0);
		} break;

	default:break;

    } // end switch

// process any messages that we didn't take care of 
return (DefWindowProc(hwnd, msg, wparam, lparam));

} // end WinProc

// WINMAIN ////////////////////////////////////////////////

int WINAPI WinMain(	HINSTANCE hinstance,
					HINSTANCE hprevinstance,
					LPSTR lpcmdline,
					int ncmdshow)
{
// this is the winmain function

WNDCLASS winclass;	// this will hold the class we create
HWND	 hwnd;		// generic window handle
MSG		 msg;		// generic message
HDC      hdc;       // generic dc
PAINTSTRUCT ps;     // generic paintstruct

// first fill in the window class stucture
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;

// register the window class
if (!RegisterClass(&winclass))
	return(0);

// create the window, note the use of WS_POPUP
if (!(hwnd = CreateWindow(WINDOW_CLASS_NAME, // class
						  "Vector tracking demo",	 // title
						  WS_POPUP | WS_VISIBLE,
					 	  0,0,	   // x,y
						  WINDOW_WIDTH,  // width
                          WINDOW_HEIGHT, // height
						  NULL,	   // handle to parent 
						  NULL,	   // handle to menu
						  hinstance,// instance
						  NULL)))	// creation parms
return(0);

// save the window handle and instance in a global
main_window_handle = hwnd;
main_instance      = hinstance;

// perform all game console specific initialization
Game_Init();

// enter main event loop
while(1)
	{
	if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
		{ 
		// test if this is a quit
        if (msg.message == WM_QUIT)
           break;
	
		// translate any accelerator keys
		TranslateMessage(&msg);

		// send the message to the window proc
		DispatchMessage(&msg);
		} // end if
    
    // main game processing goes here
    Game_Main();

	} // end while


// shutdown game and release all resources
Game_Shutdown();

// return to Windows like this
return(msg.wParam);

} // end WinMain

//////////////////////////////////////////////////////////////////////////////
   
void Load_Andre(void)
{
// this function loads all the buttons for the interface

// load image
Load_Bitmap_File(&bitmap8bit, "OUTART/ENEMYAI.DAT");

// save the palette
Copy_Palette(andre_palette, bitmap8bit.palette);

Create_Bitmap(&andre,320-216/2,240-166/2,216,166);
Load_Image_Bitmap(&andre,&bitmap8bit,0,0,BITMAP_EXTRACT_MODE_ABS);

// unload object bitmap
Unload_Bitmap_File(&bitmap8bit);

} // end Load_Andre

/////////////////////////////////////////////////////////////////

void Init_Reset_Particles(void)
{
// this function serves as both an init and reset for the particles

// loop thru and reset all the particles to dead
for (int index=0; index<MAX_PARTICLES; index++)
    {
    particles[index].state = PARTICLE_STATE_DEAD;
    particles[index].type  = PARTICLE_TYPE_FADE;
    particles[index].x     = 0;
    particles[index].y     = 0;
    particles[index].xv    = 0;
    particles[index].yv    = 0;
    particles[index].start_color = 0;
    particles[index].end_color   = 0;
    particles[index].curr_color  = 0;
    particles[index].counter     = 0;
    particles[index].max_count   = 0;
    } // end if

} // end Init_Reset_Particles

/////////////////////////////////////////////////////////////////////////

void Start_Particle(int type, int color, int count, int x, int y, int xv, int yv)
{
// this function starts a single particle

int pindex = -1; // index of particle

// first find open particle
for (int index=0; index < MAX_PARTICLES; index++)
    if (particles[index].state == PARTICLE_STATE_DEAD)
       {
       // set index
       pindex = index; 
       break;
       } // end if    

// did we find one
if (pindex==-1)
   return;

// set general state info
particles[pindex].state = PARTICLE_STATE_ALIVE;
particles[pindex].type  = type;
particles[pindex].x     = x;
particles[pindex].y     = y;
particles[pindex].xv    = xv;
particles[pindex].yv    = yv;
particles[pindex].counter     = 0;
particles[pindex].max_count   = count;     

// set color ranges, always the same
   switch(color)
         {
         case PARTICLE_COLOR_RED:
              {
              particles[pindex].start_color = COLOR_RED_START;
              particles[pindex].end_color   = COLOR_RED_END;
              } break;

         case PARTICLE_COLOR_GREEN:
              {
              particles[pindex].start_color = COLOR_GREEN_START;
              particles[pindex].end_color   = COLOR_GREEN_END;
              } break;

         case PARTICLE_COLOR_BLUE:
              {
              particles[pindex].start_color = COLOR_BLUE_START;
              particles[pindex].end_color   = COLOR_BLUE_END;
              } break;

         case PARTICLE_COLOR_WHITE:
              {
              particles[pindex].start_color = COLOR_WHITE_START;
              particles[pindex].end_color   = COLOR_WHITE_END;
              } break;

         break;

         } // end switch

// what type of particle is being requested
if (type == PARTICLE_TYPE_FLICKER)
   {
    // set current color
    particles[index].curr_color  = RAND_RANGE(particles[index].start_color, particles[index].end_color);

   } // end if
else
   {
   // particle is fade type
   // set current color
   particles[index].curr_color  = particles[index].start_color;
   } // end if

} // end Start_Particle

////////////////////////////////////////////////////////////////////////////////

void Start_Particle_Explosion(int type, int color, int count, 
                              int x, int y, int xv, int yv, int num_particles)
{
// this function starts a particle explosion at the given position and velocity

while(--num_particles >=0)
    {
    // compute random trajectory angle
    int ang = rand()%16;

    // compute random trajectory velocity
    float vel = 2+rand()%4;

    Start_Particle(type,color,count,
                   x+RAND_RANGE(-4,4),y+RAND_RANGE(-4,4), 
                   xv+cos_look16[ang]*vel, yv+sin_look16[ang]*16);        

    } // end while

} // end Start_Particle_Explosion

////////////////////////////////////////////////////////////////////////////////

void Draw_Particles(void)
{
// this function draws all the particles

// lock back surface
DDraw_Lock_Back_Surface();

for (int index=0; index<MAX_PARTICLES; index++)
    {
    // test if particle is alive
    if (particles[index].state==PARTICLE_STATE_ALIVE)
       {
       // render the particle, perform world to screen transform
       int x = particles[index].x - player_x + (SCREEN_WIDTH/2);
       int y = particles[index].y - player_y + (SCREEN_HEIGHT/2);

       // test for clip
       if (x >= SCREEN_WIDTH || x < 0 || y >= SCREEN_HEIGHT || y < 0)
          continue;

       // draw the pixel
       Draw_Pixel(x,y,particles[index].curr_color, back_buffer, back_lpitch);
    
      } // end if

    } // end for index

// unlock the secondary surface
DDraw_Unlock_Back_Surface(); 

} // end Draw_Particles

////////////////////////////////////////////////////////////////////

void Move_Particles(void)
{
// this function moves and animates all particles

for (int index=0; index<MAX_PARTICLES; index++)
    {
    // test if this particle is alive
    if (particles[index].state == PARTICLE_STATE_ALIVE)
       {
       // translate particle
       particles[index].x+=particles[index].xv;
       particles[index].y+=particles[index].yv;

       // now based on type of particle perform proper animation
       if (particles[index].type==PARTICLE_TYPE_FLICKER)
          {
          // simply choose a color in the color range and assign it to the current color
          particles[index].curr_color = RAND_RANGE(particles[index].start_color, particles[index].end_color);

          // now update counter
          if (++particles[index].counter >= particles[index].max_count)
             {
             // kill the particle
             particles[index].state = PARTICLE_STATE_DEAD;             

             } // end if

          } // end if
      else
          {
          // must be a fade, be careful!
          // test if it's time to update color
          if (++particles[index].counter >= particles[index].max_count)
             {
              // reset counter
              particles[index].counter = 0;

             // update color
             if (++particles[index].curr_color>particles[index].end_color)
                {
                // transition is complete, terminate particle
                particles[index].state = PARTICLE_STATE_DEAD;  
 
                } // end if

             } // end if

          } // end else
             
       } // end if 

    } // end for index

} // end Move_Particles

////////////////////////////////////////////////////////////////////////////////////

void Init_Stars(void)
{
// this function initializes all the stars in the star field

int index; // looping variable

for (index=0; index < MAX_STARS; index++)
    {

    // select plane that star will be in

    switch(rand()%3)
          {
          case STAR_PLANE_0:
               {
               stars[index].color = STAR_COLOR_0;
               stars[index].plane = STAR_PLANE_0;
               } break;

          case STAR_PLANE_1:
               {
               stars[index].color = STAR_COLOR_1;
               stars[index].plane = STAR_PLANE_1;
               } break;

          case STAR_PLANE_2:
               {
               stars[index].color = STAR_COLOR_2;
               stars[index].plane = STAR_PLANE_2;
               } break;

          default:break;

          } // end switch

     // set fields that aren't plane specific
     stars[index].x = rand()%SCREEN_WIDTH;   // change this latter to reflect clipping
     stars[index].y = rand()%SCREEN_HEIGHT;  // region

    } // end for index

} // end Init_Stars

/////////////////////////////////////////////////////////////////////////////

void Move_Stars(void)
{
// this function moves the star field, note that the star field is always
// in screen coordinates, otherwise, we would need thousands of stars to
// fill up the universe instead of 50!

int index,   // looping variable
    star_x,  // used as fast aliases to star position
    star_y,
    plane_0_dx,
    plane_0_dy,
    plane_1_dx,
    plane_1_dy,
    plane_2_dx,
    plane_2_dy;

// pre-compute plane translations
plane_0_dx = -int(player_xv) >> 2;
plane_0_dy = -int(player_yv) >> 2;

plane_1_dx = -int(player_xv) >> 1;
plane_1_dy = -int(player_yv) >> 1;

plane_2_dx = -int(player_xv);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜精品一区二区三区他趣| 日韩午夜小视频| 国产精品小仙女| 日韩av一区二| 秋霞国产午夜精品免费视频| 五月天激情综合| 久久国产精品色| 另类中文字幕网| 国产91精品精华液一区二区三区 | 91蝌蚪porny九色| 91色|porny| 日韩女优av电影| 337p日本欧洲亚洲大胆色噜噜| 欧美一级一区二区| 久久精品视频在线看| 中文字幕在线不卡一区二区三区| 亚洲色图在线看| 日本特黄久久久高潮| 黄色小说综合网站| 99久精品国产| 91精品在线一区二区| 久久久久久免费网| 亚洲美女淫视频| 久久se这里有精品| 91一区在线观看| 欧美情侣在线播放| 国产欧美1区2区3区| 一区二区三区日韩欧美| 久久99精品久久久久婷婷| 成a人片亚洲日本久久| 欧美伦理电影网| 国产欧美一区二区精品仙草咪 | 欧美一区二区三区免费观看视频| 精品粉嫩超白一线天av| 国产精品传媒视频| 麻豆精品久久精品色综合| 国产精品小仙女| 69堂成人精品免费视频| 欧美国产精品一区| 美美哒免费高清在线观看视频一区二区 | 欧美日韩国产首页在线观看| 精品国产伦理网| 亚洲午夜精品17c| 国产成人午夜电影网| 777奇米四色成人影色区| 国产精品福利影院| 国产一区二区伦理片| 欧美精品久久一区| 日韩伦理免费电影| 国产在线视频一区二区三区| 在线不卡免费欧美| 亚洲综合在线免费观看| 成人精品视频一区| 久久综合久久综合久久综合| 五月天亚洲精品| 成人开心网精品视频| 欧美一级日韩不卡播放免费| 亚洲成a人片综合在线| 粉嫩高潮美女一区二区三区| 久久这里都是精品| 麻豆精品蜜桃视频网站| 日韩一区二区三免费高清| 亚洲成人手机在线| 欧美性欧美巨大黑白大战| 中文字幕中文在线不卡住| 国产v综合v亚洲欧| 久久久久久99精品| 国产电影精品久久禁18| 久久影院电视剧免费观看| 精品影视av免费| 精品久久久久久久人人人人传媒| 日日骚欧美日韩| 欧美一级夜夜爽| 黄网站免费久久| 久久久精品欧美丰满| 国产高清精品久久久久| 国产亚洲女人久久久久毛片| 国产+成+人+亚洲欧洲自线| 国产欧美日韩精品一区| www.性欧美| 一区二区三区四区激情| 欧美日韩国产首页在线观看| 亚洲电影第三页| 欧美一区二区三区四区在线观看| 日本va欧美va精品| 久久综合九色综合97_久久久| 国产精品99久久久久久有的能看| 国产性色一区二区| 色综合天天综合网国产成人综合天| 亚洲丝袜自拍清纯另类| 欧美日本韩国一区二区三区视频 | 56国语精品自产拍在线观看| 日本vs亚洲vs韩国一区三区二区| 精品国产乱码久久久久久浪潮| 国产精品综合二区| 亚洲少妇中出一区| 91精品国产综合久久福利| 黄色小说综合网站| 亚洲色图一区二区三区| 3atv在线一区二区三区| 国产精品99久| 亚洲福中文字幕伊人影院| 日韩欧美一区电影| 91色九色蝌蚪| 久久精品免费观看| 亚洲精品日韩专区silk| 精品免费一区二区三区| 91麻豆国产精品久久| 美美哒免费高清在线观看视频一区二区 | 久久精品72免费观看| 国产精品初高中害羞小美女文| 欧美日韩成人在线| 成人自拍视频在线观看| 日韩电影免费在线看| 国产精品久久久久影视| 日韩一级完整毛片| 一本在线高清不卡dvd| 国产在线麻豆精品观看| 亚洲第一激情av| 国产精品久久久久久久蜜臀| 欧美一区二区三区在线视频| 成人av免费观看| 国产一区在线精品| 日本三级亚洲精品| 一区二区三国产精华液| 国产精品视频免费看| 精品对白一区国产伦| 在线播放91灌醉迷j高跟美女| aaa欧美大片| 从欧美一区二区三区| 久久精品国产秦先生| 天天av天天翘天天综合网 | 精品久久久久久久人人人人传媒| 在线免费观看日本一区| av午夜精品一区二区三区| 国产精一品亚洲二区在线视频| 日本va欧美va欧美va精品| 亚洲国产精品自拍| 一区二区激情小说| 亚洲日韩欧美一区二区在线| 国产精品视频第一区| 国产亚洲一区二区三区四区| 久久午夜电影网| 久久蜜桃av一区二区天堂| 日韩欧美电影在线| 欧美成人欧美edvon| 日韩美女一区二区三区四区| 日韩亚洲国产中文字幕欧美| 日韩一级免费观看| 精品国产一二三区| 26uuu国产一区二区三区| 欧美草草影院在线视频| 久久综合成人精品亚洲另类欧美 | 亚洲国产欧美在线| 午夜精品福利在线| 蜜桃视频在线观看一区| 久久精品国产精品亚洲综合| 极品瑜伽女神91| 国产一区二区精品久久| 丁香亚洲综合激情啪啪综合| 成人av在线网| 91成人国产精品| 91精品一区二区三区久久久久久| 678五月天丁香亚洲综合网| 91精品国产91久久久久久一区二区 | 色综合天天性综合| 在线观看91视频| 日韩一本二本av| 国产欧美一区二区精品久导航| 综合久久综合久久| 三级一区在线视频先锋| 狠狠色综合播放一区二区| 国产99一区视频免费| 日本高清不卡视频| 欧美成人国产一区二区| 欧美国产亚洲另类动漫| 亚洲大片精品永久免费| 经典三级一区二区| 日本精品一级二级| 日韩免费在线观看| 综合久久一区二区三区| 麻豆国产精品777777在线| 成人午夜电影网站| 7799精品视频| 亚洲国产精品ⅴa在线观看| 亚洲国产精品久久艾草纯爱| 精油按摩中文字幕久久| 一本一道久久a久久精品综合蜜臀| 555夜色666亚洲国产免| 日韩精品国产精品| 成人免费视频一区二区| 5月丁香婷婷综合| 亚洲视频在线一区| 激情六月婷婷久久| 欧美视频一区二区三区| 国产日韩欧美a| 美女任你摸久久| 欧美伊人精品成人久久综合97| 久久久久久99精品| 蜜桃视频一区二区|