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

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

?? demo7_13.cpp

?? 一本外國人寫的關于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:

    if (clip_list[index].bottom > region_data->rdh.rcBound.bottom)
       region_data->rdh.rcBound.bottom = clip_list[index].bottom;

    } // end for index

// now we have computed the bounding rectangle region and set up the data
// now let's set the clipping list

if (FAILED(lpddclipper->SetClipList(region_data, 0)))
   {
   // release memory and return error
   free(region_data);
   return(NULL);
   } // end if

// now attach the clipper to the surface
if (FAILED(lpdds->SetClipper(lpddclipper)))
   {
   // release memory and return error
   free(region_data);
   return(NULL);
   } // end if

// all is well, so release memory and send back the pointer to the new clipper
free(region_data);
return(lpddclipper);

} // end DDraw_Attach_Clipper

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

int DDraw_Fill_Surface(LPDIRECTDRAWSURFACE7 lpdds,int color)
{
DDBLTFX ddbltfx; // this contains the DDBLTFX structure

// clear out the structure and set the size field 
DDRAW_INIT_STRUCT(ddbltfx);

// set the dwfillcolor field to the desired color
ddbltfx.dwFillColor = color; 

// ready to blt to surface
lpdds->Blt(NULL,       // ptr to dest rectangle
           NULL,       // ptr to source surface, NA            
           NULL,       // ptr to source rectangle, NA
           DDBLT_COLORFILL | DDBLT_WAIT,   // fill and wait                   
           &ddbltfx);  // ptr to DDBLTFX structure

// return success
return(1);
} // end DDraw_Fill_Surface

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

int DDraw_Draw_Surface(LPDIRECTDRAWSURFACE7 source, // source surface to draw
                      int x, int y,                 // position to draw at
                      int width, int height,        // size of source surface
                      LPDIRECTDRAWSURFACE7 dest,    // surface to draw the surface on
                      int transparent = 1)          // transparency flag
{
// draw a bob at the x,y defined in the BOB
// on the destination surface defined in dest

RECT dest_rect,   // the destination rectangle
     source_rect; // the source rectangle                             

// fill in the destination rect
dest_rect.left   = x;
dest_rect.top    = y;
dest_rect.right  = x+width-1;
dest_rect.bottom = y+height-1;

// fill in the source rect
source_rect.left    = 0;
source_rect.top     = 0;
source_rect.right   = width-1;
source_rect.bottom  = height-1;

// test transparency flag

if (transparent)
   {
   // enable color key blit
   // blt to destination surface
   if (FAILED(dest->Blt(&dest_rect, source,
                     &source_rect,(DDBLT_WAIT | DDBLT_KEYSRC),
                     NULL)))
           return(0);

   } // end if
else
   {
   // perform blit without color key
   // blt to destination surface
   if (FAILED(dest->Blt(&dest_rect, source,
                     &source_rect,(DDBLT_WAIT),
                     NULL)))
           return(0);

   } // end if

// return success
return(1);

} // end DDraw_Draw_Surface

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

int Scan_Image_Bitmap(BITMAP_FILE_PTR bitmap,     // bitmap file to scan image data from
                      LPDIRECTDRAWSURFACE7 lpdds, // surface to hold data
                      int cx, int cy)             // cell to scan image from
{
// this function extracts a bitmap out of a bitmap file

UCHAR *source_ptr,   // working pointers
      *dest_ptr;

DDSURFACEDESC2 ddsd;  //  direct draw surface description 

// get the addr to destination surface memory

// set size of the structure
ddsd.dwSize = sizeof(ddsd);

// lock the display surface
lpdds->Lock(NULL,
            &ddsd,
            DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR,
            NULL);

// compute position to start scanning bits from
cx = cx*(ddsd.dwWidth+1) + 1;
cy = cy*(ddsd.dwHeight+1) + 1;

gwidth  = ddsd.dwWidth;
gheight = ddsd.dwHeight;

// extract bitmap data
source_ptr = bitmap->buffer + cy*bitmap->bitmapinfoheader.biWidth+cx;

// assign a pointer to the memory surface for manipulation
dest_ptr = (UCHAR *)ddsd.lpSurface;

// iterate thru each scanline and copy bitmap
for (int index_y=0; index_y < ddsd.dwHeight; index_y++)
    {
    // copy next line of data to destination
    memcpy(dest_ptr, source_ptr, ddsd.dwWidth);

    // advance pointers
    dest_ptr   += (ddsd.lPitch); // (ddsd.dwWidth);
    source_ptr += bitmap->bitmapinfoheader.biWidth;
    } // end for index_y

// unlock the surface 
lpdds->Unlock(NULL);

// return success
return(1);

} // end Scan_Image_Bitmap

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

LPDIRECTDRAWSURFACE7 DDraw_Create_Surface(int width, int height, int mem_flags, int color_key = 0)
{
// this function creates an offscreen plain surface

DDSURFACEDESC2 ddsd;         // working description
LPDIRECTDRAWSURFACE7 lpdds;  // temporary surface
    
// set to access caps, width, and height
memset(&ddsd,0,sizeof(ddsd));
ddsd.dwSize  = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;

// set dimensions of the new bitmap surface
ddsd.dwWidth  =  width;
ddsd.dwHeight =  height;

// set surface to offscreen plain
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | mem_flags;

// create the surface
if (FAILED(lpdd->CreateSurface(&ddsd,&lpdds,NULL)))
   return(NULL);

// test if user wants a color key
if (color_key >= 0)
   {
   // set color key to color 0
   DDCOLORKEY color_key; // used to set color key
   color_key.dwColorSpaceLowValue  = 0;
   color_key.dwColorSpaceHighValue = 0;

   // now set the color key for source blitting
   lpdds->SetColorKey(DDCKEY_SRCBLT, &color_key);
   } // end if

// return surface
return(lpdds);
} // end DDraw_Create_Surface


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

LRESULT CALLBACK WindowProc(HWND hwnd, 
						    UINT msg, 
                            WPARAM wparam, 
                            LPARAM lparam)
{
// this is the main message handler of the system
PAINTSTRUCT		ps;		// used in WM_PAINT
HDC				hdc;	// handle to a device context
char buffer[80];        // used to print strings

// what is the message 
switch(msg)
	{	
	case WM_CREATE: 
        {
		// do initialization stuff here
        // return success
		return(0);
		} break;
   
	case WM_PAINT: 
		{
		// simply validate the window 
   	    hdc = BeginPaint(hwnd,&ps);	 
        
        // end painting
        EndPaint(hwnd,&ps);

        // return success
		return(0);
   		} break;

	case WM_DESTROY: 
		{

		// kill the application, this sends a WM_QUIT message 
		PostQuitMessage(0);

        // return success
		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

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

int Draw_Text_GDI(char *text, int x,int y,COLORREF color, LPDIRECTDRAWSURFACE7 lpdds)
{
// this function draws the sent text on the sent surface 
// using color index as the color in the palette

HDC xdc; // the working dc

// get the dc from surface
if (FAILED(lpdds->GetDC(&xdc)))
   return(0);

// set the colors for the text up
SetTextColor(xdc,color);

// set background mode to transparent so black isn't copied
SetBkMode(xdc, TRANSPARENT);

// draw the text a
TextOut(xdc,x,y,text,strlen(text));

// release the dc
lpdds->ReleaseDC(xdc);

// return success
return(1);
} // end Draw_Text_GDI

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

int Game_Main(void *parms = NULL, int num_parms = 0)
{
// this is the main loop of the game, do all your processing
// here

// lookup for proper walking sequence
static int animation_seq[4] = {0,1,0,2};

int index; // general looping variable

// make sure this isn't executed again
if (window_closed)
   return(0);

// for now test if user is hitting ESC and send WM_CLOSE
if (KEYDOWN(VK_ESCAPE))
   {
   PostMessage(main_window_handle,WM_CLOSE,0,0);
   window_closed = 1;
   } // end if

// copy background to back buffer
DDraw_Draw_Surface(lpddsbackground,0,0, SCREEN_WIDTH,SCREEN_HEIGHT, lpddsback,0);    

// move objects around

for (index=0; index < 3; index++)
    {
    // move each object to the right at its given velocity
    aliens[index].x++; // =aliens[index].velocity;

    // test if off screen edge, and wrap around
    if (aliens[index].x > SCREEN_WIDTH)
       aliens[index].x = - 80;

    // animate bot
    if (++aliens[index].counter >= (8 - aliens[index].velocity))
        {
        // reset counter
        aliens[index].counter = 0;

        // advance to next frame
        if (++aliens[index].current_frame > 3)
           aliens[index].current_frame = 0;
  
        } // end if

    } // end for index


// draw all the bots
for (index=0; index < 3; index++)
    {
    // draw objects
    DDraw_Draw_Surface(aliens[index].frames[animation_seq[aliens[index].current_frame]], 
                       aliens[index].x, aliens[index].y,
                       72,80,
                       lpddsback);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜精品理论片a级大结局 | 一区精品在线播放| 91精品国产综合久久国产大片| 99久久国产免费看| 91在线观看成人| av高清不卡在线| 99久久精品免费精品国产| 国产成人免费在线视频| 成人性生交大片免费| 国产99精品视频| 91免费国产在线| 色婷婷激情综合| 欧美怡红院视频| 欧美人动与zoxxxx乱| 欧美一区二区三区四区视频| 欧美成人猛片aaaaaaa| 久久蜜桃av一区二区天堂| 国产欧美日韩另类一区| 国产精品美女www爽爽爽| 亚洲丝袜制服诱惑| 午夜成人在线视频| 国内精品伊人久久久久av一坑| 成人国产精品视频| 日本精品视频一区二区| 欧美日韩一区在线| 久久久久97国产精华液好用吗| 亚洲欧美日韩小说| 青娱乐精品在线视频| 99精品国产一区二区三区不卡| 欧美主播一区二区三区| 久久欧美一区二区| 亚洲精品伦理在线| 精品一区二区三区在线播放视频 | 中文字幕一区二区在线观看| 一二三四社区欧美黄| 国产一区二区三区国产| 91在线观看美女| 欧美精品一区二区三区四区 | 欧美日韩国产高清一区| 久久一二三国产| 一区二区欧美精品| 春色校园综合激情亚洲| 91超碰这里只有精品国产| 国产午夜亚洲精品理论片色戒| 麻豆视频一区二区| 一本色道综合亚洲| 久久久久久久久久美女| 欧美96一区二区免费视频| av一区二区三区四区| 精品久久99ma| 婷婷综合久久一区二区三区| 91玉足脚交白嫩脚丫在线播放| 久久综合色天天久久综合图片| 亚洲一区二区四区蜜桃| 丁香激情综合五月| 久久综合狠狠综合久久综合88| 丝袜a∨在线一区二区三区不卡| 国产精品乡下勾搭老头1| 日韩一区二区三区免费观看| 亚洲制服丝袜在线| 91色乱码一区二区三区| 中文天堂在线一区| 国产精品1区2区3区| 欧美不卡一区二区| 日本成人中文字幕| 欧美人妇做爰xxxⅹ性高电影| 亚洲五月六月丁香激情| 欧美亚洲国产bt| 亚洲综合在线观看视频| 91丨九色丨蝌蚪丨老版| 亚洲欧美另类久久久精品| 成人蜜臀av电影| 国产精品情趣视频| 成人91在线观看| 亚洲精品国产第一综合99久久| 不卡的av中国片| 中文字幕一区二| 99精品在线观看视频| 亚洲精品久久嫩草网站秘色| 99国产精品国产精品毛片| 中文字幕一区二区三区乱码在线 | 色偷偷一区二区三区| 亚洲欧美偷拍卡通变态| 色婷婷久久久久swag精品| 亚洲欧美韩国综合色| 欧美视频在线观看一区二区| 日日夜夜免费精品| 日韩欧美卡一卡二| 国产成人av在线影院| 国产精品福利一区二区三区| 在线这里只有精品| 日本成人在线电影网| 精品国产免费人成在线观看| 国产成a人亚洲精品| 夜夜操天天操亚洲| 日韩精品专区在线| 成人丝袜视频网| 亚洲精品国产视频| 日韩美一区二区三区| 粉嫩嫩av羞羞动漫久久久| 一区二区三区小说| 欧美一级片在线看| 成人国产精品免费观看| 天天色天天操综合| 国产喂奶挤奶一区二区三区| 97久久精品人人爽人人爽蜜臀| 视频一区视频二区中文字幕| 国产欧美日韩麻豆91| 欧美日韩精品一区二区天天拍小说| 美女www一区二区| 国产精品国产三级国产普通话三级 | 欧美裸体bbwbbwbbw| 国产一区二区不卡老阿姨| 最新国产成人在线观看| 538在线一区二区精品国产| 粉嫩高潮美女一区二区三区| 婷婷六月综合亚洲| 最新热久久免费视频| 精品久久久久久久人人人人传媒| www.日韩av| 国产一区二区不卡在线| 日韩经典一区二区| 亚洲精品视频在线观看免费| 精品久久国产老人久久综合| 欧美无砖砖区免费| 91啪亚洲精品| 国产一区二区三区国产| 日韩国产欧美三级| 亚洲欧美日韩精品久久久久| 久久精品网站免费观看| 欧美一区二区三区精品| 欧美在线观看视频在线| 成人午夜激情视频| 国产乱码精品一区二区三区av | 欧美久久久影院| 成人h动漫精品一区二区 | 国产精品美女久久福利网站| 精品少妇一区二区三区在线播放 | 欧美三级蜜桃2在线观看| 成人国产在线观看| 国产精品 欧美精品| 国产一区二区免费视频| 免费三级欧美电影| 奇米888四色在线精品| 亚洲一级电影视频| 一区二区三区在线观看网站| 最近日韩中文字幕| 国产精品国产三级国产有无不卡| 久久精品视频免费观看| 国产日韩精品一区二区三区在线| 日韩一级二级三级| 日韩你懂的电影在线观看| 日韩午夜在线影院| 日韩欧美电影一二三| 欧美岛国在线观看| 久久久久国产精品免费免费搜索| 亚洲精选视频在线| 亚洲影院免费观看| 亚洲综合免费观看高清完整版| 亚洲综合一区在线| 午夜av一区二区三区| 麻豆极品一区二区三区| 黄色资源网久久资源365| 国产成人av资源| av电影在线观看一区| 日本韩国精品一区二区在线观看| 色老汉一区二区三区| 欧美精品久久久久久久久老牛影院 | 在线观看区一区二| 欧美日韩一区中文字幕| 欧美成va人片在线观看| 久久久久青草大香线综合精品| 国产精品理论在线观看| 一区二区三区免费在线观看| 亚洲国产日韩在线一区模特| 久草这里只有精品视频| 99riav一区二区三区| 欧美日韩在线精品一区二区三区激情| 欧美一区二区三区免费在线看| 久久亚洲精品国产精品紫薇| 中文字幕一区二区不卡| 日韩电影免费在线观看网站| 韩国一区二区三区| av一区二区不卡| 欧美一区二区三区四区高清| 国产精品视频免费| 日本亚洲三级在线| 成人av一区二区三区| 欧美日韩精品久久久| 国产性做久久久久久| 午夜精品久久久久久久99水蜜桃 | 亚洲国产成人高清精品| 久久精品久久99精品久久| 99久久精品费精品国产一区二区| 欧美一区二区在线观看| 亚洲欧美在线高清| 久久se精品一区二区| 欧美日韩一级二级| 国产精品久久久久永久免费观看 | 国产精品对白交换视频|