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

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

?? ddapi.h

?? 赤壁之戰的游戲源代碼
?? H
字號:
//////////////////////////////
//	DDAPI.h			:	v0039
//	Written by		:	Liu Gang
//	Compiler		:	Microsoft Visual C++ 4.0 & DirectX
//	Library			:	DDraw.Lib
//	Copyright (C)	:	1996 WayAhead Corporation 
//	v0010			:	Aug.26.1996
//	v0011			:	Sep.26.1996
//	v0020			:	Nov.8.1996
//					Warning: the width of the surface cannot larger than 640 pixel
//							when this occurs, there will be only a general error code
//							and return failed.
//	v0021			:	Nov.27.1996
//	v0030			:	Dec.11.1996, upgrade DirectDraw from 1.0 to 2.0
//	v0031			:	Feb.10.1997, fixed a bug that cannot release surfaces entirly
//						add a parameter to DD_EraseFrontScreen(), DD_EraseBckScreen() and CDDSurface::Erase()
//						add CDDSurface::SetColorKeyRGB() and CDDSurface::SetColorKeyPAL(), changed color key method
//	v0032			:	Mar.7.1997, Add a member "m_bInVideo" to CDDSurface
//						To decrease the load time when surface lost
//	v0033			:	Mar.10.1997
//					Warning:	when using Lock()/Unlock() to access surface,
//							please use ddsd.lPitch to stand for the width of 
//							the source surface. Mostly, the value in ddsd.dwWidth is equal to
//                          that in ddsd.lPitch. But if the surface is in video memory, and its
//							width is less than 640, and cannot devied by 4, they do not match before you 
//							draw ddsd.lpSurface to other surfaces.
//	v0034			:	Apr.1.1997, add function FadeOut() and FadeIn(), add surface and palette counter
//							add a member "m_bCreated" and a function IfCreated() to CDDSurface
//							add a member "m_strPalette" and a function Reload() to CDDPalette
//	v0035			:	Apr.9.1997, fixed a bug that generated by last version, did not initialize m_bCreated when 
//							constructing class instance, it took two whole days.
//	v0036			:	Apr.18.1997, add CS_DBLCLKS to window style
//	v0037			:	May.6.1997, add fadein and fadeout functions, and read palette from customed palette file
//	v0038			:	May.10.1997, edited fadein and fadeout functions, to make them easy to use.
//	v0039			:	May.12.1997, changed the global palette to object
//////////////////////////////
// header file

// This file provides basic interfaces for DirectDraw with C++ 
// extension, so that someone can use more easily.
//////////////////////////////

#ifndef	__DDAPI_H__
#define	__DDAPI_H__

//////////////////////////////
#include <DDraw.h>	// Direct Draw objects, needs DDraw.lib
//////////////////////////////

//////////////////////////////
// global control
#define		DD_ERROR_ID		100
// screen size and depth
#define		SCREEN_WIDTH	640
#define		SCREEN_HEIGHT	480
#define		SCREEN_THICK	8
//////////////////////////////

//////////////////////////////
// global major window
#define		WM_DD_SURFACELOST	9999
extern		HWND	hwndGame;	// the only window in this game
//////////////////////////////

// major window
//////////////////////////////
// external initialization
// hInstance	:	handle of application instance
// nCmdShow		:	show major window or not
// strName		:	window name
// return value	:	handle of the window
HWND DD_InitWindow( HANDLE hInstance, int nCmdShow, LPCTSTR strName );

// external main procedure
// main window procedure
// defined in other file
long FAR PASCAL DD_WindowProc( HWND hWnd, UINT message, 
                            WPARAM wParam, LPARAM lParam );
//////////////////////////////

// graphic mode
//////////////////////////////
// initialize graphic system
// hwnd			:	handle of the major window
// nWidth, nHeight, nDepth:	the display mode of screen
//							default is 640x480x8
// bInVideo		:	if 1, should load back buffer surface in video memory
//					if 0, should load back buffer surface in system memory
//					if -1, can load back buffer surface anywhere
// return value	:	TRUE if succeeded
BOOL DD_InitGraph( HWND hwnd, int nWidth=-1, int nHeight=-1, int nDepth=-1, int bInVideo=-1 );

// quit graphic system
void DD_QuitGraph( void );			

// when init error occurs			
// hwnd			:	handle of the parent window
// err			:	error ID
// return value	:	Always FALSE
BOOL DD_initFail( HWND hwnd, int err );

// get front buffer pointer
// return value	:	pointer of front buffer
extern LPDIRECTDRAWSURFACE2 DD_GetFrontBuffer( void );

// get back buffer pointer
// return value	:	pointer of back buffer
extern LPDIRECTDRAWSURFACE2 DD_GetBackBuffer( void );
//////////////////////////////

// screen
//////////////////////////////
// if surface is lost, run retore
// return value	:	TRUE if succeeded
BOOL DD_RestoreScreen( void );

// draw from back buffer to front buffer
// pRect		:	rectangle region to update, full surface if it is NULL
// return value	:	TRUE if succeeded
BOOL DD_UpdateScreen( RECT *pRect=NULL );

// fill black color to front screen
// nColor		:	color index you want to fill, default is BLACK
// pRect		:	rectangle region to erase, full surface if it is NULL
// return value	:	TRUE if succeeded
BOOL DD_EraseFrontScreen( int nColor=0, RECT *pRect=NULL );

// fill black color to a given surface
// pSurface		:	surface to be erased
// nColor		:	color index you want to fill, default is BLACK
// pRect		:	rectangle region to erase, full surface if it is NULL
// return value	:	TRUE if succeeded
BOOL DD_EraseScreen( LPDIRECTDRAWSURFACE2 pSurface, int nColor, RECT *pRect/*=NULL*/ );
//////////////////////////////

// fade screen
//////////////////////////////
// fill black color to back screen
// nColor		:	color index you want to fill, default is BLACK
// pRect		:	rectangle region to erase, full surface if it is NULL
// return value	:	TRUE if succeeded
BOOL DD_EraseBackScreen( int nColor=0, RECT *pRect=NULL );

// fade in or fade out sczz
// bIn			:	TRUE for fade in screen, else for fade out screen
// nMaxStep		:	ranges from 1 to 255, set to 0 if to reset this function
// return value	:	TRUE for end session
BOOL DD_FadeScreen( BOOL bIn, int nStep=20 );

// fade out 
// nMaxStep		:	ranges from 1 to 255, set to 0 if to reset this function
// return value	:	TRUE for end session
BOOL DD_FadeOut( int nStep=20 );

// fade in 
// nMaxStep		:	ranges from 1 to 255, set to 0 if to reset this function
// return value	:	TRUE for end session
BOOL DD_FadeIn(PALETTEENTRY	 * pe,PALETTEENTRY	* peFadeSave,int nMaxStep );

// fade out screen, from color to black
// nStep		:	how much steps fade from begin to end
// nDelay		:	time each step should pause
void DD_FadeOutScreen( int nMaxStep, int nDelay );

// fade in screen, from black to color
// nStep		:	how much steps fade from begin to end
// nDelay		:	time each step should pause
// pPal			:	the palette you want to display at last
void DD_FadeInScreen( int nMaxStep, int nDelay );

// Restore saved palette from "peFadeSave" to spcecified palette 
// pointer. Usually used after DD_FadeOutScreen(), to reset the 
// palette at last, or maybe not useful after v0039.
// pPal			:	palette pointer to be restored
void DD_FadeRestore( LPDIRECTDRAWPALETTE pPal );

// Clear the palette pointer to whole black. Usually used before 
// DD_FadeInScreen(), to set a palette first and save the origional 
// value to "peFadeSave"
// pPal			:	palette to be cleared
void DD_FadeClear( LPDIRECTDRAWPALETTE pPal );
//////////////////////////////

// blt
//////////////////////////////
// draw from one surface to another
// ptDest		:	destination position in destination surface
// lprcSrc		:	source rectangle in source surface, full surface if it is NULL
// dwFlags		:	DDBLTFAST_NOCOLORKEY or DDBLTFAST_SRCCOLORKEY
// return value	:	TRUE if succeeded
BOOL DD_BltSurface( POINT ptDest, LPDIRECTDRAWSURFACE2 lpDDSDest, RECT *lprcSrc, LPDIRECTDRAWSURFACE2 lpDDSSrc, DWORD dwFlags );

// get global palette pointer
LPDIRECTDRAWPALETTE DD_GetPalette();
//////////////////////////////


//////////////////////////////
// DirectDraw surface class
class	CDDSurface
{
	LPDIRECTDRAWSURFACE2 m_lpSurface;
	LPDIRECTDRAWPALETTE m_lpPalette;

	// creation flag
	BOOL m_bCreated;	// TRUE if the surface has been created

	// bitmap attributes
	BOOL m_bHasBitmap;
	char m_strBitmap[64];
	SIZE m_szBitmap;	// size of surface

	// color key
	DWORD m_dwDrawFlag;	// with color key or not
	// if in video memory, only used when surface lost
	BOOL m_bInVideo;	// -1, auto; 0, not; 1 yes

public:
	// contructor
	CDDSurface();
	// destructor
	~CDDSurface();

// attributes
	// get size of bitmap
	SIZE GetSize(){ return m_szBitmap; }
	// get draw flag
	DWORD GetDrawFlag(){ return m_dwDrawFlag; }

	// the only way to get surface pointer
	LPDIRECTDRAWSURFACE2 GetSurface(){ return m_lpSurface; }
	// get palette of the surface
	LPDIRECTDRAWPALETTE GetPalette( void ){ return m_lpPalette; }

	// test if the surface has been created
	BOOL IfCreated(){ return m_bCreated; }

// contruction
	// create surface
	// width, height:	size of surface to create
	// bColorkey	:	TRUE if want color key, usually BLACK
	// bInVideo		:	1, should load surface in video memory
	//					0, should load surface in system memory
	//					-1, load surface anywhere possible
	// return value	:	TRUE if succeeded
	BOOL Create( int width, int height, BOOL bColorKey=FALSE, BOOL bInVideo=-1 );

	// create surface to store a bitmap, same as create()
	// strBitmap	:	bitmap filename to load
	// bColorKey	:	TRUE if want color key, usually BLACK
	// bInVideo		:	1, should load surface in video memory
	//					0, should load surface in system memory
	//					-1, load surface anywhere possible
	// return value	:	TRUE if succeeded
	BOOL LoadBitmap( LPCTSTR strBitmap, BOOL bColorKey=TRUE, BOOL bInVideo=-1 );

	// if surface is lost, run restore
	// there maybe a bug, if bitmap was loaded by Auto memory detect, 
	// and load into video memory, but got surface lost, the bitmap may
	// not be reloaded.
	// return value	:	TRUE if it is succeeded
	BOOL Restore( void );

	// reload a bitmap to an existing surface, called when surface lost
	// strBitmap:	new bitmap file name
	// return value:	TRUE if succeeded
	BOOL ReLoadBitmap( LPCTSTR strBitmap = NULL);

// color key
	// actually, you need not use these two functions to set color key, 
	// if you want color key, by default, BLACK is the color key

	// they all can run correctly on 256 color, exclusive mode.
	// in unexclusive mode, surface created by Create(), 
	//		SetColorKeyPAL() and SetColorKeyRGB() are not correct.
	// in high color mode, surface created by Create(), 
	//		SetColorKeyPAL() and SetColorKeyRGB() are not correct.
	// if surface created by LoadBitmap(), they are all correct.
	// only SetColorKeyDEF() can run correctly in any condition.

	// set colorkey by default
	// color on top left corner of the surface to be color key
	// must be used after Create() or LoadBitmap()
	// if used before, no effects
	// return	:	TRUE if successful
	BOOL SetColorKeyDEF();

	// set colorkey by given RGB value
	// must be used after Create() or LoadBitmap()
	// if used before, no effects
	// nColor	:	color key value
	// return	:	TRUE if successful
	BOOL SetColorKeyRGB( DWORD dwColor );

	// set colorkey by given palette entry
	// must be used after Create() or LoadBitmap()
	// if used before, no effects
	// if in high/true color mode, this functions is obsolete
	// nColor	:	color key value
	// return	:	TRUE if successful
	BOOL SetColorKeyPAL( BYTE nColor );

// draw
	// fill black color to the surface, full surface if it is NULL
	// nColor		:	color you want to fill, default is BLACK
	// pRect		:	region to fill, default is the entire surface
	// return value	:	TRUE if succeeded
	BOOL Erase( int nColor=0, RECT *pRect=NULL );

	// blt surface to front buffer
	// 貼圖直接到顯示面上
	// ptDest	:	destination position, top-left
	// lpercSrc	:	source rectangle, full surface if it is NULL
	// return value	:	TRUE if succeeded
	BOOL BltToFront( POINT ptDest, LPRECT lprcSrc );

	// blt my surface to back surface
	// 貼圖到背景面上
	// ptDest	:	destination position, top-left
	// lprcSrc	:	source rectangle, full surface if it is NULL
	// return value	:	TRUE if succeeded
	BOOL BltToBack( POINT ptDest, LPRECT lprcSrc );

	// blt given surface to my surface
	// if created by Create(), flags must be DDBLTFAST_NOCOLORKEY
	// if created by LoadBitmap( .., FALSE ), flags must be DDBLTFAST_NOCOLORKEY
	// if created by LoadBitmap( .., [TRUE]), flags must be DDBLTFAST_SRCCOLORKEY
	// x,y			:	Destinaiton position
	// lpsrcSurface	:	source surface
	// src			:	source rectangle, full surface if it is NULL
	// flags		:	blting flag, DDBLTFAST_NOCOLORKEY or DDBLTFAST_SRCCOLORKEY
	// return value	:	TRUE if succeeded
	BOOL CDDSurface::BltSurface( int x, int y,
		LPDIRECTDRAWSURFACE2 lpDesSurface, LPRECT src, DWORD flags );

// destruction
	// release DirectDraw object
	void Release();
};
//////////////////////////////


//////////////////////////////
// DirectDraw Palette class
#define	DD_PALTYPE_BMP	0
#define	DD_PALTYPE_PAL	1
class CDDPalette
{
	LPDIRECTDRAWPALETTE	m_lpPalette;
	int  m_nType;			// palette file type, 0 is bitmap file, 1 is palette file
	char m_strPalette[64];	// bitmap file name contains the palette

public:
	// contructor
	CDDPalette();
	// destructor
	~CDDPalette();

// attributes
	// only way to get palette
	LPDIRECTDRAWPALETTE GetPalette( void ){ return m_lpPalette; }

// construction
	// create palette object
	// strBitmap	:	bitmap file name
	// bSet			:	TRUE if should set palette to 
	//					the primary surface right after creation
	BOOL LoadPalette( LPCTSTR strBitmap , BOOL bSet=FALSE);

	// create palette object
	// strPal		:	palette file name
	// bSet			:	TRUE if should set palette to 
	//					the primary surface right after creation
	BOOL LoadPalettePAL( LPCTSTR strPal , BOOL bSet=TRUE);

// reload
	// reload palette, first release the current, then read palette from file
	// return		:	TRUE if successful
	BOOL ReloadPalette();

// set
	// set palette to primary surface
	// if color depth is higher than 256, this may result in an unkown error
	// return value	:	TRUE if succeeded
	BOOL SetPalette( void );

// destruction
	// release palette
	void Release( void );

};
//////////////////////////////
#endif



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区成人在线观看| 69堂精品视频| 亚洲图片另类小说| 色香蕉成人二区免费| 一区二区高清视频在线观看| 欧美日本在线观看| 香蕉乱码成人久久天堂爱免费| 91在线免费视频观看| 最新国产成人在线观看| 国产福利一区二区| 久久久久国产精品麻豆ai换脸| 另类小说图片综合网| 欧美大肚乱孕交hd孕妇| 欧美a级一区二区| 欧美电影免费提供在线观看| 久久99精品久久久久久国产越南 | 久久日韩精品一区二区五区| 看片网站欧美日韩| 久久婷婷成人综合色| 成人午夜又粗又硬又大| 中文字幕日韩一区二区| 色综合色狠狠天天综合色| 亚洲一区二区av电影| 91精品国产一区二区人妖| 国产69精品久久久久毛片| 亚洲高清一区二区三区| 久久久久久久久久久久久久久99 | 亚洲一本大道在线| www久久精品| 欧美最猛黑人xxxxx猛交| 精品在线观看免费| 亚洲精品一卡二卡| 一区二区三区欧美视频| yourporn久久国产精品| 亚洲色图欧美在线| 欧美电影免费观看高清完整版在线| 丁香桃色午夜亚洲一区二区三区| 午夜精品久久久久久久久久| 中文字幕第一区第二区| 欧美一区二区三区四区在线观看| 91在线观看地址| 久久99热狠狠色一区二区| 亚洲精品中文字幕在线观看| 久久精品视频一区二区| 欧美一区二区三区四区视频| 在线一区二区观看| 成人免费va视频| 狠狠色丁香九九婷婷综合五月| 亚洲一卡二卡三卡四卡 | 欧美视频一区二区在线观看| 国产精品综合久久| 蜜臀久久99精品久久久画质超高清| 亚洲精品你懂的| 国产精品区一区二区三区| 日韩三级视频在线看| 欧洲生活片亚洲生活在线观看| 国产成人精品影院| 久草在线在线精品观看| 免费人成网站在线观看欧美高清| 国产精品免费人成网站| 国产亚洲综合色| 久久综合狠狠综合久久激情| 日韩午夜精品视频| 日韩欧美国产一二三区| 7777精品伊人久久久大香线蕉的 | 色综合久久久久| 国产毛片精品视频| 三级成人在线视频| 自拍偷拍欧美激情| 日韩欧美在线观看一区二区三区| jlzzjlzz国产精品久久| 精品亚洲aⅴ乱码一区二区三区| 亚洲精品高清在线观看| 中文字幕不卡在线| 久久综合九色综合97婷婷女人 | 亚洲人快播电影网| 亚洲毛片av在线| 亚洲国产综合人成综合网站| 亚洲精品视频观看| 亚洲二区视频在线| 亚洲123区在线观看| 日韩成人一区二区| 精品一区二区国语对白| 男男成人高潮片免费网站| 麻豆91免费观看| 精品亚洲免费视频| 国产美女久久久久| av在线不卡免费看| 日本道色综合久久| 欧美性猛片aaaaaaa做受| 7777精品伊人久久久大香线蕉超级流畅 | 欧美精品九九99久久| 欧美日韩国产另类一区| 欧美成人综合网站| 国产欧美一区二区三区在线老狼| 欧美国产综合色视频| 亚洲欧洲中文日韩久久av乱码| 一区二区三区欧美| 免费观看日韩av| 高清不卡在线观看| 日本韩国欧美一区| 日韩精品一区二区三区四区视频| 国产目拍亚洲精品99久久精品| 亚洲男人的天堂在线观看| 五月婷婷久久丁香| 国产尤物一区二区在线| 99精品偷自拍| 日韩三级伦理片妻子的秘密按摩| 久久久精品免费免费| 一区二区三区在线免费| 老司机精品视频一区二区三区| 波多野结衣一区二区三区| 欧美日韩精品高清| 国产精品丝袜久久久久久app| 亚洲中国最大av网站| 国产伦理精品不卡| 欧美日韩国产天堂| 国产精品久久久久影院色老大| 亚洲3atv精品一区二区三区| 风流少妇一区二区| 欧美日韩国产系列| 中文字幕欧美日本乱码一线二线 | 免费在线欧美视频| 91亚洲国产成人精品一区二区三| 555夜色666亚洲国产免| 中文欧美字幕免费| 日韩成人精品在线| 91免费视频大全| 久久久精品日韩欧美| 日日摸夜夜添夜夜添国产精品| 成人丝袜18视频在线观看| 在线不卡一区二区| 自拍偷拍亚洲综合| 国产成人综合在线| 欧美va日韩va| 婷婷丁香激情综合| 99re66热这里只有精品3直播| 日韩精品专区在线| 亚洲午夜精品久久久久久久久| 成人精品亚洲人成在线| 精品久久久久久久久久久久包黑料 | 成人激情免费电影网址| 欧美精品乱人伦久久久久久| 亚洲女性喷水在线观看一区| 国产麻豆视频一区| 日韩三级.com| 手机精品视频在线观看| 欧美性猛片xxxx免费看久爱| 亚洲免费观看视频| 波多野结衣91| 国产日韩av一区| 国产一区二区精品久久91| 欧美一区二区三区色| 日本在线不卡一区| 在线不卡欧美精品一区二区三区| 亚洲人成小说网站色在线| 国产乱子伦一区二区三区国色天香| 在线观看成人免费视频| 亚洲欧洲日产国码二区| 成人黄色av电影| 日本一区二区不卡视频| 大桥未久av一区二区三区中文| 久久久99久久| 国产精品一区二区视频| 久久女同性恋中文字幕| 国产成人精品三级麻豆| 欧美国产精品一区二区| 成人听书哪个软件好| 国产精品久久久久四虎| 91在线观看视频| 亚洲免费高清视频在线| 91论坛在线播放| 亚洲精品日韩专区silk| 日本韩国一区二区| 丝袜脚交一区二区| 欧美一级片在线| 久久国产精品99久久人人澡| 精品毛片乱码1区2区3区| 国产美女一区二区三区| 国产精品高清亚洲| 欧美无砖专区一中文字| 日韩精彩视频在线观看| 欧美一区二区三区电影| 久久99精品国产91久久来源| 精品国产91亚洲一区二区三区婷婷| 精品一区二区国语对白| 国产精品天天摸av网| 91美女在线观看| 日韩中文字幕亚洲一区二区va在线 | 日本一区二区不卡视频| 一本大道久久精品懂色aⅴ| 天堂蜜桃91精品| 久久嫩草精品久久久久| 色综合色综合色综合| 日韩精品一区第一页| 中文字幕第一区第二区| 欧美日韩精品一区二区三区| 麻豆成人免费电影| 国产精品久久久久久一区二区三区| 欧美性猛片xxxx免费看久爱|