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

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

?? demo12_5_16b.cpp

?? 一本外國人寫的關于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// DEMO12_5_16b.CPP - pattern 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 "WINXCLASS"  // class name

// setup a 640x480 16-bit windowed mode example
#define WINDOW_TITLE      "16-Bit Pattern 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_PATTERNS    4     // number of patterns in system

// pattern instruction opcodes for bot

// directional instructions
#define OPC_E    0  // move west
#define OPC_NE   1  // move northeast
#define OPC_N    2  // move north
#define OPC_NW   3  // move northwest
#define OPC_W    4  // move west
#define OPC_SW   5  // move southwest
#define OPC_S    6  // move south
#define OPC_SE   7  // move southeast

// special instructions
#define OPC_STOP 8  // stop for a moment
#define OPC_RAND 9  // select a random direction
#define OPC_END  -1 // end pattern

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

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

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

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

BITMAP_IMAGE background_bmp;   // holds the background
BOB          bot;              // the demo robot ship

// patterns in opcode operand format
int pattern_1[] = {OPC_W, 10, OPC_NW, 10, OPC_N, 10, OPC_NE, 10, 
                   OPC_E, 10, OPC_SE, 10, OPC_S, 10, OPC_SW, 10, 
                   OPC_W, 10, OPC_RAND, 10,
                   
                   OPC_W, 20, OPC_NW, 10, OPC_N, 20, OPC_NE, 10, 
                   OPC_E, 20, OPC_SE, 10, OPC_S, 20, OPC_SW, 10, 
                   OPC_W, 10, OPC_END,0};
                   

int pattern_2[] = {OPC_E, 20, OPC_W, 20, OPC_STOP, 20, OPC_NE, 10, 
                   OPC_W, 10, OPC_NW, 10, OPC_SW, 20, OPC_NW, 20, 
                   OPC_SW, 20, OPC_NW, 30, OPC_SW, 10, OPC_S, 50,  
                   OPC_W, 2, OPC_NW, 2, OPC_N, 2, OPC_NE, 50,
                   OPC_E,2, OPC_SE,2, OPC_S,2, OPC_RAND, 10, OPC_END,0};



int pattern_3[] = { OPC_N, 10, OPC_S, 10, OPC_N, 10, OPC_S, 10, 
                    OPC_E, 10, OPC_W, 10, OPC_E, 10, OPC_W, 10, 
                    OPC_NW, 10, OPC_N, 10, OPC_NE, 10, OPC_N, 10, 
                    OPC_STOP, 20, OPC_RAND, 5, OPC_E, 50, OPC_S, 50, OPC_W, 50, 
                    OPC_E, 10, OPC_E, 10, OPC_E, 10, OPC_NW, 100, 
                    OPC_STOP, 10, OPC_END,0};


int pattern_4[] = {OPC_W, 100, 
                   OPC_NW, 2,OPC_N, 2,OPC_NE, 2,
                   OPC_E, 100, 
                   OPC_NE, 2,OPC_N, 2,OPC_NW, 2,
                    
                   OPC_W, 100, 
                   OPC_NW, 2,OPC_N, 2,OPC_NE, 2,
                   OPC_E, 100, 
                   OPC_NE, 2,OPC_N, 2,OPC_NW, 2,
                    
                   OPC_W, 100, 
                   OPC_NW, 2,OPC_N, 2,OPC_NE, 2,
                   OPC_E, 100, 
                   OPC_NE, 2,OPC_N, 2,OPC_NW, 2,

                   OPC_RAND, 10, OPC_RAND, 5,

                   OPC_SW, 2,OPC_S, 2,OPC_SE, 2,
                   OPC_E, 100, 
                   OPC_SE, 2,OPC_S, 2,OPC_SW, 2,
                   OPC_W, 100,

                   OPC_SW, 2,OPC_S, 2,OPC_SE, 2,
                   OPC_E, 100, 
                   OPC_SE, 2,OPC_S, 2,OPC_SW, 2,
                   OPC_W, 100,

                   OPC_SW, 2,OPC_S, 2,OPC_SE, 2,
                   OPC_E, 100, 
                   OPC_SE, 2,OPC_S, 2,OPC_SW, 2,
                   OPC_W, 100, OPC_END,0};

// master pattern array
int *patterns[NUM_PATTERNS] = {pattern_1, pattern_2, pattern_3, pattern_4};

int *curr_pattern=NULL;  // current pattern being processed

int bot_ip     =0,       // pattern instruction pointer for bot
    bot_counter=0,       // counter of pattern control
    bot_pattern_index;   // the current pattern being executed

// used as a index to string lookup to help print out
char *opcode_names[] = {"OPC_E",
                        "OPC_NE", 
                        "OPC_N",    
                        "OPC_NW",   
                        "OPC_W",    
                        "OPC_SW",   
                        "OPC_S",    
                        "OPC_SE",   
                        "OPC_STOP", 
                        "OPC_RAND", 
                        "OPC_END",};  
// sound stuff
int engines_id = -1; // engine sound id

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

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

int bot_anim[2];

// initialize directdraw, very important that in the call
// to setcooperativelevel that the flag DDSCL_MULTITHREADED is used
// which increases the response of directX graphics to
// take the global critical section more frequently
DDraw_Init(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_BPP, WINDOWED_APP);

// load background image
Load_Bitmap_File(&bitmap16bit, "TREKB24.BMP");
Create_Bitmap(&background_bmp,0,0,640,480,16);
Load_Image_Bitmap16(&background_bmp, &bitmap16bit,0,0,BITMAP_EXTRACT_MODE_ABS);
Unload_Bitmap_File(&bitmap16bit);

// load the bots bitmaps

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久亚洲国产美女国产盗摄 | 精品日产卡一卡二卡麻豆| 欧美精品xxxxbbbb| 久久久综合视频| 亚洲国产裸拍裸体视频在线观看乱了| 久久精品国产77777蜜臀| 国产精品一区免费视频| 欧美色视频在线观看| 国产欧美日韩视频一区二区| 亚洲国产精品久久人人爱| 国产69精品久久99不卡| 欧美乱妇15p| 国产精品国产成人国产三级| 久久 天天综合| 欧美午夜在线一二页| 国产精品久久午夜夜伦鲁鲁| 蜜臀精品一区二区三区在线观看| 99久久精品久久久久久清纯| 欧美成人性战久久| 日韩激情一区二区| 色屁屁一区二区| 国产精品国产馆在线真实露脸| 精品午夜一区二区三区在线观看| 欧美日韩精品一区二区| 亚洲人成伊人成综合网小说| 国产一区二区精品在线观看| 91精品国产麻豆国产自产在线| 一区二区三区中文在线| 91在线观看地址| 国产婷婷色一区二区三区四区| 麻豆精品一区二区综合av| 欧美日韩国产小视频| 亚洲激情五月婷婷| 色综合天天在线| |精品福利一区二区三区| 大桥未久av一区二区三区中文| 日韩欧美精品在线| 免费高清不卡av| 久久亚洲精华国产精华液| 一区二区三区在线高清| 91美女在线观看| 中文字幕一区av| 91污片在线观看| 亚洲激情成人在线| 欧美日韩综合不卡| 午夜成人在线视频| 欧美一区二区视频在线观看2020 | 国产乱国产乱300精品| 欧美mv日韩mv| 国产激情精品久久久第一区二区 | 亚洲免费在线播放| 欧美日韩精品三区| 免费精品视频在线| 精品动漫一区二区三区在线观看| 免费黄网站欧美| 久久香蕉国产线看观看99| 成人一区二区三区中文字幕| 国产精品久线观看视频| 91久久精品日日躁夜夜躁欧美| 一区二区成人在线观看| 欧美麻豆精品久久久久久| 六月丁香综合在线视频| 国产无一区二区| 色94色欧美sute亚洲线路一ni| 天天射综合影视| 久久亚洲一区二区三区四区| 91麻豆国产福利在线观看| 三级一区在线视频先锋| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 91激情在线视频| 日日欢夜夜爽一区| 26uuu精品一区二区在线观看| 暴力调教一区二区三区| 亚洲第一成人在线| 久久婷婷综合激情| 在线一区二区三区做爰视频网站| 日韩国产精品久久久久久亚洲| 欧美精品在线观看播放| 国产呦精品一区二区三区网站| 国产精品久久久久久久久免费樱桃 | 粉嫩av一区二区三区粉嫩| 一区二区三区四区av| 日韩美一区二区三区| 成人激情午夜影院| 麻豆国产精品视频| 亚洲欧美另类久久久精品| 日韩视频国产视频| 在线观看亚洲专区| 国产成人啪免费观看软件| 亚欧色一区w666天堂| 国产精品久久久久久久裸模| 日韩精品资源二区在线| 91女厕偷拍女厕偷拍高清| 极品尤物av久久免费看| 亚洲自拍偷拍网站| 国产精品久久午夜| 亚洲精品一区二区三区99| 欧美在线观看18| 9久草视频在线视频精品| 国产中文字幕一区| 日韩中文字幕麻豆| 亚洲一区二区三区激情| 国产精品久久国产精麻豆99网站| 日韩欧美一二三区| 91精品国产欧美一区二区成人 | 1区2区3区欧美| 国产午夜精品福利| 久久久久久电影| 日韩片之四级片| 欧美精品在线一区二区三区| 在线看一区二区| 99久久精品免费看| 91在线一区二区三区| 成人一级片网址| 国产成人精品综合在线观看 | 在线观看不卡一区| 99国产一区二区三精品乱码| 成人一区在线观看| av在线不卡免费看| jvid福利写真一区二区三区| 成人丝袜视频网| 成人丝袜高跟foot| 色综合婷婷久久| 欧美在线观看一区| 欧美精品xxxxbbbb| 日韩欧美国产一区二区在线播放 | 一级做a爱片久久| 亚洲精品大片www| 一区二区三区四区在线| 一区二区三区精品视频在线| 亚洲一区二区在线观看视频| 一区二区三区蜜桃| 午夜不卡av在线| 美女一区二区在线观看| 国产一区久久久| 国产成人在线视频网站| 99精品热视频| 欧洲人成人精品| 91精品在线免费| 久久综合色婷婷| 国产精品美女视频| 亚洲同性同志一二三专区| 亚洲一区二区在线免费观看视频| 日韩专区一卡二卡| 国产精品99久久久久久似苏梦涵| 成人av在线一区二区| 色拍拍在线精品视频8848| 5858s免费视频成人| 久久一区二区三区国产精品| 国产精品萝li| 三级成人在线视频| 国产成a人亚洲精品| 日本道色综合久久| 日韩欧美区一区二| 综合电影一区二区三区 | 美女国产一区二区三区| 国产精品一级二级三级| 91免费观看在线| 日韩亚洲国产中文字幕欧美| 国产精品久久夜| 乱一区二区av| 91久久精品一区二区| 久久久不卡网国产精品一区| 亚洲乱码国产乱码精品精可以看 | 亚洲最色的网站| 久久国产尿小便嘘嘘尿| 一本色道久久综合亚洲91| 日韩欧美国产精品| 亚洲人成网站精品片在线观看| 蜜臀国产一区二区三区在线播放| 成人动漫在线一区| 91精品国产综合久久香蕉麻豆| 国产精品伦理一区二区| 欧美aⅴ一区二区三区视频| 91亚洲男人天堂| 51精品久久久久久久蜜臀| 亚洲美女一区二区三区| 国精品**一区二区三区在线蜜桃| 91福利区一区二区三区| 国产日韩欧美精品一区| 久久精品欧美一区二区三区不卡| 亚洲综合一区在线| 99视频在线精品| 久久久久久一级片| 奇米影视一区二区三区小说| 在线观看成人小视频| 亚洲色欲色欲www在线观看| 精品一区二区三区在线视频| 欧美日韩成人激情| 中文字幕综合网| 成人免费视频一区二区| 亚洲精品一区二区三区福利 | 国产日韩欧美高清在线| 日韩电影一区二区三区| 欧美四级电影网| 亚洲人成网站色在线观看| 91丨九色丨黑人外教| 国产精品久久久久久久久免费相片 | 亚洲欧洲av在线| 成人免费va视频|