亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
91久久精品一区二区二区| 国内不卡的二区三区中文字幕| 国产在线精品一区二区三区不卡| 日韩欧美电影一区| 国产在线播精品第三| 国产婷婷精品av在线| 北条麻妃一区二区三区| 一区二区三区精密机械公司| 欧美撒尿777hd撒尿| 视频一区免费在线观看| 精品乱人伦小说| 成人午夜又粗又硬又大| 亚洲精品欧美二区三区中文字幕| 欧美天堂亚洲电影院在线播放| 亚洲韩国一区二区三区| 日韩欧美亚洲一区二区| 成人小视频免费在线观看| 亚洲欧美电影院| 日韩一区二区免费电影| 丰满少妇久久久久久久| 亚洲精品中文在线观看| 91精品国产一区二区三区香蕉| 极品尤物av久久免费看| 99视频精品在线| 日韩欧美一级精品久久| 亚洲日本成人在线观看| 香港成人在线视频| 国产精品一卡二卡| 在线观看91av| 欧美日韩国产123区| 欧美偷拍一区二区| 91网站最新地址| 亚洲情趣在线观看| 精品一区二区三区在线播放视频| 成人永久免费视频| 亚洲欧美自拍偷拍色图| 精品91自产拍在线观看一区| 91福利国产成人精品照片| 国产人成一区二区三区影院| 日韩和欧美的一区| 99re8在线精品视频免费播放| 欧美日韩精品系列| 色视频欧美一区二区三区| 欧美日韩精品欧美日韩精品一综合| 国产欧美日韩亚州综合| 午夜伦理一区二区| 国产电影一区在线| 国产精品高潮久久久久无| 日韩av电影天堂| 久久精品一二三| 91蝌蚪porny| 欧美午夜一区二区三区| 欧美激情资源网| 亚洲一区二区三区四区中文字幕| 亚洲精品中文字幕乱码三区| 久久99久久久久久久久久久| 色噜噜狠狠色综合欧洲selulu | 欧美精品乱人伦久久久久久| 欧美成人女星排行榜| 亚洲精品美国一| 精品一区二区三区久久久| 色狠狠色狠狠综合| 国产欧美日韩另类视频免费观看| 在线精品视频免费播放| 国产精品视频一区二区三区不卡| 免费欧美在线视频| 蜜桃av一区二区在线观看| 国产夫妻精品视频| 国产精品卡一卡二| 91一区二区在线| 性做久久久久久免费观看欧美| 不卡电影免费在线播放一区| 婷婷综合久久一区二区三区| 国产一区二三区好的| 国产女主播视频一区二区| 在线观看av一区| 最好看的中文字幕久久| 欧美大胆一级视频| 欧美影院一区二区| 色综合久久久久综合99| 国产一区二区剧情av在线| 蜜臀av一区二区在线观看| 性做久久久久久久久| 亚洲码国产岛国毛片在线| 国产三级精品三级| 久久久久亚洲综合| 精品美女在线播放| 欧美一级一级性生活免费录像| 在线免费视频一区二区| 在线观看日韩一区| 91一区二区在线| 91在线免费播放| 91视频你懂的| 91麻豆国产在线观看| aaa欧美大片| 国产成人精品1024| 国产中文字幕精品| 精品一区二区三区香蕉蜜桃| 日本欧美肥老太交大片| 天天av天天翘天天综合网 | 日韩一级免费一区| 欧美高清激情brazzers| 欧美日韩大陆在线| 91精品国产综合久久久久久漫画| 欧美日韩激情一区| 日韩欧美国产系列| 久久婷婷综合激情| 中文字幕中文字幕一区| 日韩视频不卡中文| 日韩欧美一区在线| 国产精品欧美极品| 一区二区三区日韩| 日韩黄色片在线观看| 免播放器亚洲一区| 国产剧情一区二区三区| 丁香婷婷综合网| 在线免费观看日韩欧美| 3d动漫精品啪啪一区二区竹菊| 日韩欧美一区二区视频| 国产欧美一区在线| 日韩理论片网站| 日韩精品免费专区| 国产精品亚洲成人| 日本韩国一区二区三区视频| 欧美人妇做爰xxxⅹ性高电影| 日韩午夜三级在线| 中文字幕高清不卡| 天天综合色天天综合色h| 国产一区999| 在线一区二区三区| 欧美成人伊人久久综合网| 国产欧美精品在线观看| 亚洲国产成人porn| 国产成人精品影院| 日本韩国一区二区三区| 欧美精品一区二区三区蜜桃视频| 国产精品久久久久久福利一牛影视| 亚洲精品国产a| 国产毛片精品一区| 精品视频一区二区不卡| 国产人久久人人人人爽| 午夜免费久久看| 成年人午夜久久久| 国产欧美精品日韩区二区麻豆天美| 亚洲免费成人av| 久久se精品一区精品二区| 色婷婷综合中文久久一本| 日韩欧美精品三级| 亚洲欧洲美洲综合色网| 韩国理伦片一区二区三区在线播放| 91女人视频在线观看| 日韩午夜中文字幕| 一区二区三区欧美| 国产成人综合在线播放| 6080yy午夜一二三区久久| 亚洲天堂免费在线观看视频| 秋霞电影一区二区| 欧美视频在线播放| 自拍偷拍亚洲欧美日韩| 经典一区二区三区| 欧美精三区欧美精三区| 久久久久亚洲综合| 日本不卡视频一二三区| 欧美日韩高清在线| 亚洲一区二区综合| 色吧成人激情小说| 亚洲天堂精品视频| 成人激情av网| 久久久欧美精品sm网站| 毛片一区二区三区| 91精品在线观看入口| 亚洲一级二级三级在线免费观看| 99精品视频中文字幕| 久久精品夜夜夜夜久久| 国产在线视视频有精品| 欧美一级xxx| 日av在线不卡| 91成人在线免费观看| 精品久久久久久久久久久院品网| 舔着乳尖日韩一区| 欧美狂野另类xxxxoooo| 性做久久久久久免费观看欧美| 欧美艳星brazzers| 亚洲成a天堂v人片| 欧美老女人第四色| 日韩av不卡在线观看| 欧美老肥妇做.爰bbww| 石原莉奈一区二区三区在线观看| 欧美精品v国产精品v日韩精品 | 成人免费高清视频在线观看| 国产亚洲自拍一区| 丁香六月综合激情| 欧美国产在线观看| www.色综合.com| 亚洲精品免费播放| 91福利视频久久久久| 亚洲三级久久久| 欧美久久久久免费| 蜜桃久久精品一区二区| 欧美一区午夜精品|