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

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

?? demo12_8.cpp

?? 游戲的聲音圖像演示程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// DEMO12_8.CPP - path finding racing demo
// to compile make sure to include DDRAW.LIB, DSOUND.LIB,
// DINPUT.LIB, WINMM.LIB, and of course 
// T3DLIB1.CPP,T3DLIB2.CPP,T3DLIB3.CPP,

// INCLUDES ///////////////////////////////////////////////

#define INITGUID

#define WIN32_LEAN_AND_MEAN  

#include <windows.h>   // include important windows stuff
#include <windowsx.h> 
#include <mmsystem.h>
#include <iostream.h> // include important C/C++ stuff
#include <conio.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h> 
#include <math.h>
#include <io.h>
#include <fcntl.h>

#include <ddraw.h>  // directX includes
#include <dsound.h>
#include <dmksctrl.h>
#include <dmusici.h>
#include <dmusicc.h>
#include <dmusicf.h>
#include <dinput.h>
#include "T3DLIB1.h" // game library includes
#include "T3DLIB2.h"
#include "T3DLIB3.h"

// DEFINES ////////////////////////////////////////////////

// defines for windows 
#define WINDOW_CLASS_NAME "WINCLASS"  // class name

#define WINDOW_WIDTH    320   // size of window
#define WINDOW_HEIGHT   240

#define NUM_WAYPOINTS 30 // number of waypoints in path

// PROTOTYPES /////////////////////////////////////////////

// game console
int Game_Init(void *parms=NULL);
int Game_Shutdown(void *parms=NULL);
int Game_Main(void *parms=NULL);

// TYPES /////////////////////////////////////////////////

typedef struct WAYPOINT_TYP
        {
        float x,y;

        } WAYPOINT, *WAYPOINT_PTR;


// GLOBALS ////////////////////////////////////////////////

HWND main_window_handle           = NULL; // save the window handle
HINSTANCE main_instance           = NULL; // save the instance
char buffer[256];                          // used to print text

BITMAP_IMAGE background_bmp;   // holds the background

BOB          car; // this little race car

int wind_sound_id = -1;        // the ambient wind
int car_sound_id = -1;         // the engine of the car

int vector_display_on = 1;     // used to toggle the informational vector rendering

// the way point list hand compiled :)
WAYPOINT path[NUM_WAYPOINTS] = { 

{332,122}, 
{229,108}, 
{155,97}, 
{104,100}, 
{67,119}, 
{46,159}, 
{55,229}, 
{74,283}, 
{132,364}, 
{206,407}, 
{268,412}, 
{291,405}, 
{303,379}, 
{312,274}, 
{336,244}, 
{383,233}, 
{417,240}, 
{434,278}, 
{426,328}, 
{407,388}, 
{418,415}, 
{452,429}, 
{501,419}, 
{534,376}, 
{562,263}, 
{562,188}, 
{556,112}, 
{530,100}, 
{484,97},
{404,116},};                     


// FUNCTIONS //////////////////////////////////////////////

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

// 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
						  "Waypoint Path finding 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

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

int Find_Nearest_Waypoint(float x, float y)
{
// this function finds the nearest waypoint to the sent position

int near_id = 0;
int near_dist = 1000,
    test_dist;

for (int index=0; index<NUM_WAYPOINTS; index++)
    {
    // is this waypoint closer?
    if ((test_dist = Fast_Distance_2D(path[index].x - x,path[index].y - y)) < near_dist)
       {
       // set as nearest waypoint
       near_id = index;
       near_dist = test_dist;   
       } // end if

    } // end for index

// test if user want to see all those lines
if (vector_display_on==1)
   {
   // draw it
   DDraw_Lock_Back_Surface();
   Draw_Line(path[near_id].x, path[near_id].y - 8,path[near_id].x, path[near_id].y + 8,
              250, back_buffer, back_lpitch); 

   Draw_Line(path[near_id].x-8, path[near_id].y ,path[near_id].x+8, path[near_id].y,
              250, back_buffer, back_lpitch); 
   DDraw_Unlock_Back_Surface();
   } // end if

// return it
return(near_id);

} // end Find_Nearest_Waypoint

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

void Draw_Waypoints(int mode=1)
{
// this function draws the waypoints and the path network

// lock back surface
DDraw_Lock_Back_Surface();

for (int index=0; index < NUM_WAYPOINTS; index++)
    {
    // draw network line too?
    if (mode > 0)
       Draw_Line(path[index].x, path[index].y,
                 path[(index+1)%NUM_WAYPOINTS].x, path[(index+1)%NUM_WAYPOINTS].y,
                 249,   
                 back_buffer, back_lpitch); // video buffer and memory pitch

   Draw_Pixel(path[index].x, path[index].y, 250, back_buffer, back_lpitch);
   Draw_Pixel(path[index].x+1, path[index].y, 250, back_buffer, back_lpitch);
   Draw_Pixel(path[index].x, path[index].y+1, 250, back_buffer, back_lpitch);
   Draw_Pixel(path[index].x+1, path[index].y+1, 250, back_buffer, back_lpitch);

    } // end for index

// lock back surface
DDraw_Unlock_Back_Surface();

} // end Draw_Waypoints

// T3D GAME PROGRAMMING CONSOLE FUNCTIONS ////////////////

int Game_Init(void *parms)
{
// this function is where you do all the initialization 
// for your game

int index; // looping variable

// start up DirectDraw (replace the parms as you desire)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区日本| 久久欧美一区二区| 午夜亚洲福利老司机| 欧美日韩一区高清| 日韩精品欧美成人高清一区二区| 欧美日本韩国一区二区三区视频 | 国产无一区二区| 国产成人精品免费| 日本不卡在线视频| 欧美一区二区女人| 久久精品免费观看| 国产日韩精品一区| 91麻豆国产福利精品| 亚洲线精品一区二区三区| 91精品国产乱| 国产精品亚洲第一区在线暖暖韩国| 久久久www成人免费毛片麻豆 | 免费成人在线观看视频| 久久这里只精品最新地址| 日韩一区二区在线观看视频播放 | 日韩激情视频网站| 久久中文娱乐网| 色哟哟欧美精品| 男女男精品视频网| 国产精品美女久久久久久久久久久| 色婷婷久久久亚洲一区二区三区| 日韩高清不卡一区二区三区| 国产免费久久精品| 欧美日韩国产一区二区三区地区| 国产一区二区三区久久久| 国产精品一区三区| 亚洲欧美乱综合| 精品日韩欧美一区二区| 99精品欧美一区二区三区小说| 日本va欧美va瓶| 国产精品萝li| 精品欧美一区二区久久| 色婷婷亚洲综合| 国产黑丝在线一区二区三区| 亚洲最新视频在线观看| 久久久久久亚洲综合影院红桃| 欧美日韩精品久久久| 高清不卡一二三区| 日本高清不卡视频| 国内不卡的二区三区中文字幕| 亚洲综合免费观看高清完整版在线| 久久色在线观看| 欧美日韩国产电影| 一本色道久久综合亚洲91| 久久99久久99| 日韩精品一级二级 | 国产免费观看久久| 欧美电视剧免费全集观看| 色视频欧美一区二区三区| 东方欧美亚洲色图在线| 91视频com| 成人午夜伦理影院| 久久av中文字幕片| 日韩精品福利网| 亚洲综合一二三区| 亚洲欧美色一区| 欧美激情在线一区二区| 欧美不卡123| 欧美日韩激情一区二区| 色丁香久综合在线久综合在线观看| 丁香五精品蜜臀久久久久99网站 | 国产成人av电影在线播放| 91麻豆免费看| 成人免费高清在线| 成人在线视频一区| 丁香桃色午夜亚洲一区二区三区| 美国十次了思思久久精品导航| 亚洲不卡av一区二区三区| 一级日本不卡的影视| 一区二区三区影院| 亚洲高清在线视频| 亚洲成人资源在线| 午夜亚洲福利老司机| 日韩在线播放一区二区| 奇米色777欧美一区二区| 色综合激情五月| av不卡免费在线观看| 波多野结衣在线aⅴ中文字幕不卡| 成人免费视频视频| 成人激情av网| 91国产免费观看| 欧美视频在线不卡| 制服丝袜成人动漫| 欧美一区二区三区在线观看| 欧美一区二区三区播放老司机| 日韩无一区二区| 精品成人免费观看| 国产网红主播福利一区二区| 国产精品久久久久久久蜜臀| 麻豆91精品视频| 日本女优在线视频一区二区| 国产一区二区三区日韩| 久久99精品久久久久久动态图| 国产精品一二三| 不卡av免费在线观看| 欧美在线不卡视频| 日韩欧美一级片| 国产精品色眯眯| 亚洲777理论| 国产一区二区美女| 色综合欧美在线视频区| 欧美一区二区三区不卡| 国产亚洲欧美日韩在线一区| 亚洲嫩草精品久久| 91在线你懂得| 日韩一区二区在线观看视频播放| 久久久久久电影| 一区二区三区蜜桃网| 免费一级欧美片在线观看| 国产精品一线二线三线精华| aaa国产一区| 欧美一三区三区四区免费在线看 | 中文字幕一区在线观看视频| 亚洲亚洲精品在线观看| 91福利国产精品| 久久蜜臀精品av| 亚洲成人一区在线| 国产91精品一区二区麻豆亚洲| 欧美日韩一区二区在线观看视频| 久久久久青草大香线综合精品| 亚洲国产日韩综合久久精品| 国产一区二区免费在线| 欧美三级在线看| 亚洲国产成人自拍| 麻豆成人在线观看| 欧美在线免费视屏| 日本一区二区三区视频视频| 丝袜亚洲另类欧美综合| 色综合久久久久| 日本成人在线网站| av在线播放成人| 久久久久国色av免费看影院| 水蜜桃久久夜色精品一区的特点| 成人激情动漫在线观看| 精品国产一区二区在线观看| 亚洲成人综合在线| 99re这里只有精品视频首页| 亚洲精品一线二线三线无人区| 亚洲18影院在线观看| 成人免费黄色大片| 久久女同性恋中文字幕| 日韩国产一二三区| 欧美曰成人黄网| 亚洲欧美日韩电影| 日韩一级二级三级| 亚洲午夜日本在线观看| 91在线观看成人| 国产精品久久久久久妇女6080| 久久99精品久久久久久久久久久久| 337p亚洲精品色噜噜| 亚洲在线中文字幕| 欧美曰成人黄网| 亚洲激情自拍视频| 91丨porny丨国产入口| 国产精品欧美综合在线| 粉嫩蜜臀av国产精品网站| 欧美变态tickle挠乳网站| 日本不卡123| 7777精品伊人久久久大香线蕉超级流畅 | 日韩一区欧美小说| 国产成都精品91一区二区三| 精品国精品自拍自在线| 久久99热99| 欧美成人伊人久久综合网| 奇米在线7777在线精品| 日韩美女在线视频| 狠狠色丁香久久婷婷综| 久久久久久久网| 国产成人aaaa| 中文字幕字幕中文在线中不卡视频| av电影在线观看一区| 国产精品一区二区久久不卡 | 亚洲成在线观看| 制服视频三区第一页精品| 日本不卡视频在线观看| 日韩一卡二卡三卡| 黑人精品欧美一区二区蜜桃| 久久久777精品电影网影网 | 国内外成人在线| 国产日韩精品一区二区三区在线| av一区二区三区黑人| 亚洲欧美日韩一区二区| 欧美人与禽zozo性伦| 免费在线看成人av| 亚洲高清在线视频| 日韩免费看的电影| 成人免费视频网站在线观看| 有码一区二区三区| 在线播放日韩导航| 国产成人免费视频精品含羞草妖精| 国产欧美一区二区精品仙草咪| 99久久er热在这里只有精品15 | 久久精品一区四区| 99国产精品久久久久久久久久| 亚洲一区免费在线观看|