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

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

?? demo13_9_16b.cpp

?? 一本外國人寫的關于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// DEMO13_9_16b.CPP - 2D Forward Kinematic demo
// 16-bit version, make sure that your desktop is in 16-bit mode!
// 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 2D Forward Kinematic 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 ARM_ANG         2   // arm rotation angle increment

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

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

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


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

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

void Copy_Polygon2D(POLYGON2D_PTR dest, POLYGON2D_PTR source);

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

POLYGON2D arm1[2], arm2[2];       // the arms of the linkage
                                  // since the transform function modify
                                  // the local coordites, I need two versions, 
                                  // so I can make a copy of the original object and always
                                  // transform from there, this is just because normally
                                  // you have a set of local coords and the transformed temp
                                  // coords, but I saved space and made them the same, so
                                  // this is a fix to make it work
                                  // hence index 0 is original and 1 will be transformed

// 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(&bitmap8bit, "ARMGRID24.BMP");
Create_Bitmap(&background_bmp,0,0,640,480,16);
Load_Image_Bitmap16(&background_bmp, &bitmap8bit,0,0,BITMAP_EXTRACT_MODE_ABS);
Unload_Bitmap_File(&bitmap8bit);

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

// initialize directinput
DInput_Init();

// acquire the keyboard only
DInput_Init_Keyboard();

// initilize DirectSound

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
2017欧美狠狠色| 7777精品伊人久久久大香线蕉超级流畅| 一区二区三区成人| 亚洲国产婷婷综合在线精品| 亚洲丝袜美腿综合| 亚洲欧美日韩久久精品| 洋洋av久久久久久久一区| 日韩精品电影一区亚洲| 秋霞午夜av一区二区三区| 九色综合狠狠综合久久| 成人国产视频在线观看| 色呦呦网站一区| 在线播放日韩导航| 欧美国产日韩a欧美在线观看| 中文字幕在线观看不卡视频| 麻豆成人综合网| 国产·精品毛片| 色av成人天堂桃色av| 国产亚洲欧美日韩日本| 一级精品视频在线观看宜春院| 亚洲精品ww久久久久久p站| 日韩福利视频网| 在线观看日产精品| 国产精品国产三级国产aⅴ原创| 亚洲国产视频一区二区| 成人综合婷婷国产精品久久| 欧美日韩国产经典色站一区二区三区| 久久蜜臀精品av| 丝袜美腿成人在线| 欧美日韩大陆一区二区| 亚洲日本在线a| 9人人澡人人爽人人精品| 欧美videossexotv100| 亚洲成av人片| 欧美精品丝袜中出| 亚洲一二三四在线| 精品久久久久久综合日本欧美| 欧美日韩一区中文字幕| 国产精品灌醉下药二区| 久久av老司机精品网站导航| 久久久久久99久久久精品网站| 一本一道久久a久久精品| 日本欧美大码aⅴ在线播放| 国产精品嫩草99a| 欧美一区二区私人影院日本| 成人精品免费看| 久久国产夜色精品鲁鲁99| 亚洲美女区一区| 久久日韩粉嫩一区二区三区| 欧美视频在线一区| 99re热视频精品| 国产不卡在线视频| 毛片av一区二区| 婷婷国产v国产偷v亚洲高清| 久久久噜噜噜久久中文字幕色伊伊 | 亚洲成人av中文| 樱桃国产成人精品视频| 久久―日本道色综合久久| 日韩欧美一区二区三区在线| 欧美日精品一区视频| 色哟哟欧美精品| jizzjizzjizz欧美| 91色porny在线视频| 成人av免费在线| 一本大道久久a久久精品综合| 成人一级视频在线观看| 99精品久久久久久| 欧美在线观看一区二区| 成人99免费视频| 成人av在线电影| 色香蕉久久蜜桃| 欧美人动与zoxxxx乱| 国产91富婆露脸刺激对白| 久久精品国产久精国产| 三级久久三级久久久| 亚洲一二三四区不卡| 亚洲精品大片www| 亚洲一区二区三区中文字幕| 亚洲婷婷综合久久一本伊一区 | 国产91精品露脸国语对白| 久久精品免费看| 久久99精品国产.久久久久| 久久国产日韩欧美精品| 男女性色大片免费观看一区二区| 免费一区二区视频| 欧美色国产精品| 欧美亚洲综合色| 日韩三级免费观看| 国产日韩欧美电影| 亚洲一区在线视频观看| 亚洲国产成人高清精品| 日韩av成人高清| 成人午夜av电影| 欧美三级电影在线看| 欧美日韩一区二区三区在线| 精品国产免费一区二区三区香蕉| 91精品国产色综合久久不卡电影| 日韩网站在线看片你懂的| 国产日韩欧美一区二区三区综合| 国产精品天天看| 亚洲一区二区三区自拍| 毛片av一区二区| 色婷婷综合激情| 欧美成人午夜电影| 国产精品欧美一区二区三区| 亚洲激情一二三区| 久久91精品国产91久久小草| 成人禁用看黄a在线| 欧美精品三级在线观看| 亚洲欧美色图小说| 国产999精品久久久久久| 国产精品免费视频网站| 国产激情一区二区三区四区| 日韩美女一区二区三区四区| 国产成人综合视频| 国产欧美日产一区| 色婷婷综合激情| 亚洲天堂福利av| 在线观看精品一区| 亚洲伊人色欲综合网| 日本韩国一区二区三区| 亚洲愉拍自拍另类高清精品| 欧美亚洲动漫另类| 婷婷丁香久久五月婷婷| 欧美精品一二三| 国产一区999| 国产精品久久久久久久久免费樱桃 | 亚洲成人激情av| 欧美日韩亚洲不卡| 久久不见久久见免费视频1| 欧美日韩的一区二区| 欧美大片一区二区三区| 99久久精品国产毛片| 午夜精品一区二区三区电影天堂| 国产麻豆成人传媒免费观看| 精品久久久久久久久久久久包黑料| 国产aⅴ综合色| 蜜桃视频在线观看一区| 国产精品人成在线观看免费| 欧美视频精品在线| 国产91精品免费| 国产伦精一区二区三区| 婷婷综合五月天| 亚洲一二三区在线观看| 国产精品对白交换视频| 日韩精品一区国产麻豆| 男女男精品网站| 99视频精品免费视频| 欧美日本一区二区在线观看| 国产精品久久一级| 成人av影院在线| 亚洲成人免费看| 精品视频色一区| 石原莉奈在线亚洲三区| 欧美日韩一区三区| 欧美在线播放高清精品| 欧美日韩一卡二卡| 国产白丝精品91爽爽久久| 久久国产综合精品| 4438x成人网最大色成网站| 亚洲一级不卡视频| 欧美性大战久久久久久久蜜臀| 亚洲乱码精品一二三四区日韩在线| 国产成人精品www牛牛影视| 欧美一卡二卡在线观看| 天天色天天操综合| 欧美一区二区三区视频免费播放 | 欧美在线999| 亚洲日本在线a| 91影视在线播放| 日韩理论在线观看| 色综合 综合色| 亚洲韩国精品一区| 欧美男同性恋视频网站| 日本不卡123| 日韩三级在线免费观看| 久久99久久99精品免视看婷婷| 欧美成人性福生活免费看| 国产一区二区三区精品欧美日韩一区二区三区 | 国产亚洲va综合人人澡精品| 丁香网亚洲国际| 国产精品久久福利| 久久久噜噜噜久久中文字幕色伊伊 | 欧美不卡一区二区三区四区| 麻豆久久久久久| 国产情人综合久久777777| 91在线丨porny丨国产| 亚洲综合男人的天堂| 日韩一区二区在线观看视频播放| 韩国av一区二区三区| 成人欧美一区二区三区小说| 欧美丝袜丝交足nylons图片| 日韩av一区二| 中文字幕不卡在线| 91国产视频在线观看| 激情综合网天天干| 亚洲欧美另类久久久精品| 欧美另类高清zo欧美| 国产麻豆9l精品三级站| 一区二区在线观看不卡|