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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? demo13_4_16b.cpp

?? 一本外國人寫的關(guān)于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// DEMO13_4_16b.CPP - 2D trajectory demo
// 16-bit version
// to compile make sure to include DDRAW.LIB, DSOUND.LIB,
// DINPUT.LIB, WINMM.LIB, and of course the T3DLIB files

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

// defines for polygon cannon
#define CANNON_X0  39       // position of tip of cannon
#define CANNON_Y0  372
#define NUM_PROJECTILES 16  // number of projectiles

// MACROS ///////////////////////////////////////////////

#define RAND_RANGE(x,y) ( (x) + (rand()%((y)-(x)+1)))

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

typedef struct PROJ_TYP
{
int state;      // state 0 off, 1 on
float x,y;      // position
float xv, yv;   // velocity

} PROJECTILE, *PROJECTILE_PTR;


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

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

// missile interface
void Init_Projectiles(void);
void Move_Projectiles(void);
void Draw_Projectiles(void);
void Fire_Projectile(int angle, float vel);

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

int cannon_ids[8]; // sound ids

POLYGON2D cannon; // the ship

PROJECTILE missiles[NUM_PROJECTILES]; // array of missiles

float gravity_force =  0.2;  // gravity
float wind_force    = -0.01; // wind resistance

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

char filename[80]; // used to build up filenames

// seed random number generate
srand(Start_Clock());

// 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, "TANKGRID24.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);

// hide the mouse
if (!WINDOWED_APP)
   ShowCursor(FALSE);

// initialize directinput
DInput_Init();

// acquire the keyboard only
DInput_Init_Keyboard();

// initilize DirectSound
DSound_Init();

// load background sounds

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产经典欧美精品| 日韩中文欧美在线| 久久在线观看免费| 日韩美一区二区三区| 欧美一区二区精品在线| 日韩欧美精品三级| 欧美精品一区二区三区高清aⅴ| 日韩欧美卡一卡二| 欧美激情综合五月色丁香| 亚洲国产高清在线观看视频| 国产精品美女一区二区三区| 亚洲私人黄色宅男| 午夜欧美在线一二页| 轻轻草成人在线| 国产剧情在线观看一区二区| 成人综合婷婷国产精品久久免费| 9人人澡人人爽人人精品| 在线亚洲高清视频| 欧美r级在线观看| 国产精品三级电影| 亚洲国产精品嫩草影院| 日韩av高清在线观看| 国产成人亚洲综合a∨婷婷图片 | 欧美三级欧美一级| 欧美一区二区在线免费观看| 久久综合精品国产一区二区三区| 日本一区二区三区dvd视频在线| 玉足女爽爽91| 另类小说图片综合网| 成人的网站免费观看| 欧美在线观看禁18| 久久久久9999亚洲精品| 亚洲免费在线视频一区 二区| 日韩黄色小视频| 成人福利视频网站| 日韩一级在线观看| 1区2区3区精品视频| 蜜桃视频在线一区| 欧美在线三级电影| 欧美激情艳妇裸体舞| 日韩 欧美一区二区三区| 成人ar影院免费观看视频| 91精品国产91久久综合桃花| 中文一区二区完整视频在线观看| 天堂蜜桃91精品| 91污片在线观看| 久久久777精品电影网影网| 午夜视频在线观看一区二区三区| 国产精品1区2区3区| 91精品国产色综合久久| 亚洲欧美日韩国产中文在线| 国产激情一区二区三区桃花岛亚洲 | 亚洲黄一区二区三区| 国产黄色精品视频| 日韩欧美精品在线| 日韩影院精彩在线| 欧美性xxxxx极品少妇| 国产精品毛片大码女人| 黄色日韩三级电影| 日韩精品在线看片z| 午夜不卡在线视频| 欧美性生活久久| 亚洲精品视频在线观看网站| 国产成人精品www牛牛影视| 精品99久久久久久| 久久精品国产免费| 67194成人在线观看| 亚洲国产精品视频| 欧美体内she精高潮| 亚洲一区电影777| 日本道色综合久久| 亚洲精品中文在线| 欧美主播一区二区三区美女| 亚洲人成网站在线| 日本韩国精品一区二区在线观看| 国产精品视频第一区| 豆国产96在线|亚洲| 国产精品毛片久久久久久久| 不卡视频在线观看| 亚洲欧美国产三级| 欧美色成人综合| 奇米在线7777在线精品| 日韩精品一区二区三区视频| 免费成人av在线| 亚洲精品一区二区在线观看| 国产成人精品午夜视频免费 | 日本一区二区成人在线| 国产福利一区二区三区在线视频| 欧美高清在线精品一区| 91色婷婷久久久久合中文| 又紧又大又爽精品一区二区| 欧美三区在线视频| 久久精品999| 欧美激情中文字幕| 91浏览器入口在线观看| 天堂一区二区在线免费观看| 2023国产精品| 91亚洲男人天堂| 五月激情六月综合| 精品入口麻豆88视频| bt7086福利一区国产| 日韩精品欧美精品| 久久久一区二区三区捆绑**| 95精品视频在线| 热久久一区二区| 中文字幕一区二区三区乱码在线 | 日韩区在线观看| 国内精品国产三级国产a久久 | 欧洲精品中文字幕| 美女网站在线免费欧美精品| 久久久99精品久久| 欧美日韩亚洲国产综合| 国产大陆a不卡| 亚洲国产日日夜夜| 国产精品欧美久久久久一区二区| 欧美性受极品xxxx喷水| 高潮精品一区videoshd| 亚洲成av人在线观看| 国产欧美日韩不卡| 欧美一级黄色录像| 色播五月激情综合网| 国产精品一区在线观看乱码| 亚洲电影在线免费观看| 国产精品视频在线看| 日韩一区国产二区欧美三区| 91国偷自产一区二区开放时间| 久久www免费人成看片高清| 亚洲一区在线观看视频| 国产视频视频一区| 日韩免费观看高清完整版在线观看| 不卡的av中国片| 国产露脸91国语对白| 日韩精品乱码av一区二区| 亚洲乱码一区二区三区在线观看| 久久久久国产免费免费| 欧美成人一级视频| 日韩一区二区中文字幕| 日本精品一级二级| 91免费看视频| 处破女av一区二区| 国产成人99久久亚洲综合精品| 日韩福利电影在线观看| 亚洲va欧美va天堂v国产综合| 亚洲人成亚洲人成在线观看图片| 2023国产精品视频| 久久久亚洲精华液精华液精华液| 日韩欧美资源站| 欧美人与z0zoxxxx视频| 欧美视频日韩视频在线观看| 91官网在线观看| 在线一区二区三区| 在线观看国产91| 欧美午夜一区二区三区 | 日韩影视精彩在线| 国产精品一区2区| 精品午夜久久福利影院 | 樱桃国产成人精品视频| 综合久久国产九一剧情麻豆| 中文字幕日韩av资源站| 亚洲色图第一区| 一级特黄大欧美久久久| 亚洲丶国产丶欧美一区二区三区| 亚洲一区二区成人在线观看| 午夜精品aaa| 久热成人在线视频| 国产成人av电影在线观看| 成人午夜视频福利| 91黄色免费观看| 欧美一区二区三区播放老司机| 日韩午夜精品电影| 久久久久国产免费免费| 自拍av一区二区三区| 亚洲成人资源网| 久久机这里只有精品| 成人污视频在线观看| 色妹子一区二区| 日韩欧美一区电影| 欧美国产日韩a欧美在线观看| 亚洲三级电影网站| 视频一区欧美日韩| 国产福利91精品一区| 色婷婷精品久久二区二区蜜臀av| 在线不卡的av| 国产精品三级视频| 日本成人在线一区| 成人国产电影网| 欧美一区二区在线免费观看| 国产免费久久精品| 午夜精品一区在线观看| 国产乱子轮精品视频| 在线免费观看日本欧美| 日韩三级在线免费观看| 一区视频在线播放| 国产主播一区二区| 欧美午夜在线观看| 国产精品视频线看| 国产综合色在线视频区| 欧美视频一区二| 最近日韩中文字幕| 极品少妇xxxx精品少妇|