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

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

?? demo12_8_16b.cpp

?? 一本外國人寫的關于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// DEMO12_8_16b.CPP - path finding racing demo
// 16-bit version
// 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

// setup a 640x480 16-bit windowed mode example
#define WINDOW_TITLE      "16-Bit Path Finding Demo"
#define WINDOW_WIDTH      640   // size of window
#define WINDOW_HEIGHT     480

#define WINDOW_BPP        16    // bitdepth of window (8,16,24 etc.)
                                // note: if windowed and not
                                // fullscreen then bitdepth must
                                // be same as system bitdepth
                                // also if 8-bit the a pallete
                                // is created and attached

#define WINDOWED_APP      1     // 0 not windowed, 1 windowed

#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

WNDCLASSEX winclass; // this will hold the class we create
HWND	   hwnd;	 // generic window handle
MSG		   msg;		 // generic message
HDC        hdc;      // graphics device context

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

// save hinstance in global
main_instance = hinstance;

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

// create the window
if (!(hwnd = CreateWindowEx(NULL,                  // extended style
                            WINDOW_CLASS_NAME,     // class
						    WINDOW_TITLE, // title
						    (WINDOWED_APP ? (WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION) : (WS_POPUP | WS_VISIBLE)), 
					 	    0,0,	  // initial x,y
						    WINDOW_WIDTH,WINDOW_HEIGHT,  // initial width, height
						    NULL,	  // handle to parent 
						    NULL,	  // handle to menu
						    hinstance,// instance of this application
						    NULL)))	// extra creation parms
return(0);

// save main window handle
main_window_handle = hwnd;

if (WINDOWED_APP)
{
// now resize the window, so the client area is the actual size requested
// since there may be borders and controls if this is going to be a windowed app
// if the app is not windowed then it won't matter
RECT window_rect = {0,0,WINDOW_WIDTH-1,WINDOW_HEIGHT-1};

// make the call to adjust window_rect
AdjustWindowRectEx(&window_rect,
     GetWindowStyle(main_window_handle),
     GetMenu(main_window_handle) != NULL,
     GetWindowExStyle(main_window_handle));

// save the global client offsets, they are needed in DDraw_Flip()
window_client_x0 = -window_rect.left;
window_client_y0 = -window_rect.top;

// now resize the window with a call to MoveWindow()
MoveWindow(main_window_handle,
           0, // x position
           0, // y position
           window_rect.right - window_rect.left, // width
           window_rect.bottom - window_rect.top, // height
           TRUE);

// show the window, so there's no garbage on first render
ShowWindow(main_window_handle, SW_SHOW);
} // end if windowed

// 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_Line16(path[near_id].x, path[near_id].y - 8,path[near_id].x, path[near_id].y + 8,
              RGB16Bit(0,0,255), back_buffer, back_lpitch); 

   Draw_Line16(path[near_id].x-8, path[near_id].y ,path[near_id].x+8, path[near_id].y,
              RGB16Bit(0,0,255), 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_Line16(path[index].x, path[index].y,
                 path[(index+1)%NUM_WAYPOINTS].x, path[(index+1)%NUM_WAYPOINTS].y,
                 RGB16Bit(255,0,0),   

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷亚洲久悠悠色悠在线播放| 五月激情综合婷婷| 亚洲最新视频在线播放| 蜜桃免费网站一区二区三区| 成人精品视频一区二区三区尤物| 欧美日韩精品综合在线| 中文字幕欧美日韩一区| 日韩电影在线免费| 在线视频你懂得一区二区三区| 日韩精品在线看片z| 亚洲国产综合色| 成人激情黄色小说| 26uuu国产在线精品一区二区| 婷婷亚洲久悠悠色悠在线播放| www..com久久爱| 2023国产精品自拍| 视频一区二区欧美| 欧美日本一区二区三区四区| 亚洲精品视频观看| 99国产精品久久久久久久久久| 国产日韩欧美激情| 国产一本一道久久香蕉| 日韩一区二区影院| 日韩在线卡一卡二| 欧美亚洲一区二区在线| 中文字幕在线不卡国产视频| 国产高清在线观看免费不卡| 精品国产伦理网| 蜜臀久久99精品久久久久宅男| 欧美日本在线一区| 天天色图综合网| 欧美日韩大陆一区二区| 亚洲国产精品尤物yw在线观看| 在线视频国内自拍亚洲视频| 亚洲一区二区在线视频| 在线亚洲+欧美+日本专区| 亚洲欧洲韩国日本视频| 一本到一区二区三区| 亚洲日本护士毛茸茸| jlzzjlzz国产精品久久| 亚洲少妇30p| 一本色道a无线码一区v| 亚洲精品视频在线看| 欧美性大战xxxxx久久久| 亚洲一二三专区| 欧美人狂配大交3d怪物一区| 视频一区二区三区中文字幕| 日韩欧美久久久| 国产精品77777| 亚洲乱码精品一二三四区日韩在线| 91理论电影在线观看| 亚洲国产你懂的| 日韩一区二区免费视频| 国产麻豆视频精品| 亚洲欧洲av在线| 在线观看网站黄不卡| 亚洲 欧美综合在线网络| 日韩免费一区二区三区在线播放| 国产在线一区观看| 国产精品福利一区| 欧美午夜片在线看| 久久99最新地址| 国产精品萝li| 欧美日韩国产不卡| 国产69精品久久久久毛片| 一区二区在线看| www日韩大片| 91久久精品一区二区三区| 久久精品久久综合| 综合久久久久久| 日韩午夜精品视频| 91偷拍与自偷拍精品| 奇米影视一区二区三区小说| 国产精品网曝门| 91精品国产综合久久精品麻豆| 国产精品综合av一区二区国产馆| 日韩伦理电影网| 精品国产乱码久久久久久影片| 91首页免费视频| 狠狠色丁香婷婷综合久久片| 一区二区三区在线免费视频| 亚洲精品一区二区三区香蕉| 欧美制服丝袜第一页| 国产成人a级片| 天天综合网天天综合色| 国产精品私房写真福利视频| 欧美一区二区三区播放老司机 | 亚洲一区二区三区四区在线免费观看 | 亚洲综合免费观看高清在线观看| 欧美va亚洲va香蕉在线| 一本一本大道香蕉久在线精品 | 日韩精品一区二| 欧美图片一区二区三区| 国产精品亚洲第一| 亚洲在线中文字幕| 国产精品国产三级国产普通话99| 精品少妇一区二区三区| 欧美绝品在线观看成人午夜影视| 99r精品视频| 国产成人午夜高潮毛片| 美女一区二区视频| 婷婷丁香激情综合| 一区二区不卡在线播放| 国产精品蜜臀av| 久久精品视频一区二区三区| 91精品国产麻豆| 91精品啪在线观看国产60岁| 欧美日韩成人综合天天影院| 欧美视频你懂的| 欧美日韩国产一级片| 欧美日韩一二三区| 欧美三级乱人伦电影| 欧美午夜一区二区三区免费大片| 在线亚洲一区观看| 91久久免费观看| 欧美性色黄大片| 欧美视频你懂的| 69久久夜色精品国产69蝌蚪网| 欧美日韩国产在线播放网站| 欧美高清精品3d| 91精品国产一区二区三区| 欧美高清视频不卡网| 日韩久久久久久| 国产午夜精品在线观看| 国产亚洲精品bt天堂精选| 国产日韩欧美一区二区三区综合| 中文字幕av一区二区三区高| 中文字幕中文字幕一区| 最好看的中文字幕久久| 亚洲精品老司机| 日韩在线播放一区二区| 精品在线观看免费| 国产**成人网毛片九色| 日本韩国一区二区三区视频| 日本韩国欧美国产| 在线成人高清不卡| 日韩精品在线网站| 国产精品视频免费看| 亚洲精品国产成人久久av盗摄| 天天爽夜夜爽夜夜爽精品视频| 国产在线日韩欧美| www.成人网.com| 欧美一区永久视频免费观看| 2024国产精品| 一区二区三区产品免费精品久久75| 亚洲男人的天堂av| 日本视频一区二区三区| 国产一区二区三区| 91在线高清观看| 91精品福利在线一区二区三区| 国产亚洲人成网站| 亚洲人午夜精品天堂一二香蕉| 五月综合激情婷婷六月色窝| 国产成人精品三级麻豆| 一本大道久久a久久精二百| 欧美日产国产精品| 国产精品久久久久久久久免费相片| 亚洲国产精品久久久久婷婷884 | 日韩成人精品在线观看| 国产乱淫av一区二区三区| 色天天综合色天天久久| 日韩限制级电影在线观看| 亚洲男人的天堂一区二区| 国模冰冰炮一区二区| 欧美日韩一区二区在线视频| 国产精品嫩草99a| 免费日本视频一区| 色综合色狠狠综合色| 精品国产免费久久 | 欧美一区日韩一区| 中文字幕一区二区三区色视频| 天堂va蜜桃一区二区三区 | 91精品国产综合久久久久久久久久 | 亚洲综合网站在线观看| 国产二区国产一区在线观看| 91.麻豆视频| 亚洲精品菠萝久久久久久久| 国产成人福利片| 精品久久久久久久久久久久久久久| 亚洲色图制服诱惑| 国产成人精品一区二 | 欧美午夜免费电影| 中文字幕一区二区在线播放| 日本在线播放一区二区三区| 欧美在线短视频| 亚洲欧美aⅴ...| 成人av资源站| 国产精品免费看片| 国产精品一区二区免费不卡 | 国产精品美日韩| 国产精品1024| 欧美精品一区二区蜜臀亚洲| 视频一区国产视频| 在线播放91灌醉迷j高跟美女 | 国产毛片精品国产一区二区三区| 欧美不卡激情三级在线观看| 男女激情视频一区| 日韩欧美国产精品一区| 蜜臀av一区二区三区| 日韩欧美一级精品久久|