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

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

?? gl.h

?? 游戲c++開發簡例
?? H
?? 第 1 頁 / 共 2 頁
字號:
#ifndef __GRAPHIC_LIB
#define __GRAPHIC_LIB

//#include <crtdbg.h>
//#include <stdio.h>
#include <afx.h>

struct ScreenInfo{
	DWORD width;
	DWORD height;
	DWORD colorDepth;
};
// screenInfo defined in bitmap.cpp
extern ScreenInfo screenInfo;	//set by ddraw.cpp
//用于從像素中取得顏色分量
extern DWORD colorMask[6];
//用于alpha,beta非MMX計算,rbMask取紅藍,gMask取綠(cloudwu算法)
extern DWORD rbMask, gMask;

struct PixelInfo{
	int colorRedMask;
	int colorRedPos;
	int redMask;
	int redPos;

	int colorGreenMask;
	int colorGreenPos;
	int greenMask;
	int greenPos;

	int colorBlueMask;
	int colorBluePos;
	int blueMask;
	int bluePos;
};
extern PixelInfo pixelInfo16, pixelInfo15, pixelInfo24, pixelInfo32;

// 
int InitGraphicLibrary( int colorDepth );

/////////////////////////////////////////////////////////////////////
// 調色板

#define PAL_SIZE	256

typedef int RGB;

struct ColorEntry{
	union{
		struct{
		BYTE rgbBlue;
		BYTE rgbGreen;
		BYTE rgbRed;
		BYTE rgbRsvd ;
		};
		DWORD rgb;
	};
};

struct Palette{
	int count;
	ColorEntry palette[ PAL_SIZE ];
	int screenPal[ PAL_SIZE ];	// convert to current pixel mode
	
	Palette();
	void AddRef( void );
	void Release( void );
	void Convert( void );
	void Destroy( void );
	void WriteToDisk( FILE *fp, int num = PAL_SIZE );
	void ReadFromDisk( FILE *fp, int num = PAL_SIZE );
};


/////////////////////////////////////////////////////////////////////
// 內存位圖及其操作函數

#define BYTES_PER_PIXEL( a ) (( a + 7 ) >> 3 )
#define COLOR_INDEX( c ) ( c & 0x80000000 )

#define COLORKEY8   0
#define COLORKEY15	0x7c1f
#define COLORKEY16  0xf81f
#define COLORKEY24  0xff00ff
#define COLORKEY32  0xff00ff

class Bitmap;
class Bitmap15;
class Bitmap16;

Bitmap* CreateBitmap( int w, int h );
Bitmap* CreateBitmapEx( int w, int h, int colorDepth );
Bitmap* LoadBmp( char *filename, Palette *pal );
Bitmap* LoadTga( char *filename, Palette *pal );
Bitmap* LoadPicture( char* filename, int convert = 1, Palette* pal = NULL );
int SaveTga( char *filename, Bitmap *bmp );

class Bitmap{
public:
	static int drawMode;	// solid, xor, blend ( not support pattern )
	static int alpha;
	
	enum{
		SolidMode = 0x1,
		XorMode = 0x2,
		AlphaMode = 0x4,
		BetaMode = 0x8
		};
			
	int width, height;
	int colorDepth;
	int clip;	// true or false
	int cl, ct, cr, cb;	//clip rectangle
	void* dat;	//data area
/*	int id;		//ID
	int dx, dy;	// for sub bitmap
*/	char** line;	// line addresses
	int color; 	// current color	
	int colorKey;	// SOURCE and TARGET color key
	int pitch;	// the scanline length in dat ( the same as directdraw )
					//( may be larger than actual length for alignment purpose )
	
	// functions
	Bitmap();

	int  GetClip(){
		return clip;
	};
	
	void SetClip( int l, int t, int r, int b );
	void SetClip( int enable );
	void SetDrawMode( int drawmode, int alpha );

	virtual Bitmap* ConvertFormat( int ) = 0;
	virtual int  MakeColor( RGB color ) = 0;
	virtual void SetColor( RGB color ) = 0;
	virtual void SetColorKey( RGB color ) = 0;

	// color = 0x00rrggbb ( 15,16,24,32 ) / 0x800000cc ( 8bit color )
	virtual DWORD GetPixel( int x, int y ) = 0;
	virtual void PutPixel( int x, int y ) = 0; 
	virtual void Blit( Bitmap* dest, int dx, int dy, int sx, int sy, int w, int h ) = 0;
	virtual void BlitMask( Bitmap* dest, int dx, int dy, int sx, int sy, int w, int h ) = 0;
	virtual void Clear( int l, int t, int w, int h, int color = COLORKEY16 ) = 0;

};

// supports 8 bits color mode 
class Bitmap8 : public Bitmap{ 
public:
	Palette *palette;

	~Bitmap8();
	
	virtual void Blit( Bitmap* dest, int dx, int dy, int sx, int sy, int w, int h );
	virtual void BlitInside8( int x, int y, int sx, int sy, int w, int h );
	virtual void BlitOutside8( Bitmap8* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void BlitMask( Bitmap* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void BlitMasked8( Bitmap8* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void BlitMaskedTo16( Bitmap16* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void Clear( int l, int t, int w, int h, int color = COLORKEY8 );
	virtual Bitmap* ConvertFormat( int );
	virtual DWORD GetPixel( int x, int y );
	virtual void PutPixel( int x, int y ); 
	
	inline virtual int MakeColor( RGB color ){ 
		return 0; 
	};
	inline virtual int  GetR( int pixel ){
		return 0;
	};
	inline virtual int  GetG( int pixel ){
		return 0;
	};
	inline virtual int  GetB( int pixel ){
		return 0;
	};
	virtual void SetColor( RGB color );
	virtual void SetColorKey( RGB color );
};

// 15/16位色位圖的基類
class BitmapHi : public Bitmap{
public:

	virtual void Blit( Bitmap* dest, int dx, int dy, int sx, int sy, int w, int h );
	virtual void BlitMask( Bitmap* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void Clear( int l, int t, int w, int h, int color = COLORKEY16 );
	// 輔助函數
	virtual void BlitMasked( Bitmap* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void BlitInside( int x, int y, int sx, int sy, int w, int h );
	virtual void BlitOutside( Bitmap* dest, int x, int y, int sx, int sy, int w, int h );

	BitmapHi();
	~BitmapHi();

	virtual Bitmap* ConvertFormat( int ) = 0;
	virtual DWORD GetPixel( int x, int y );
	virtual void PutPixel( int x, int y ); 
	virtual int  MakeColor( RGB color ) = 0;

	// set current draw color
	inline virtual void SetColor( RGB color )
	{
		Bitmap::color = MakeColor( color );
	};
	// set color key
	inline virtual void SetColorKey( RGB color ){
		colorKey = MakeColor( color );
	};

};

// 565模式的位圖
class Bitmap16 : public BitmapHi{
public:

	virtual Bitmap* ConvertFormat( int );

	inline virtual int  MakeColor( RGB color )
	{
		return (((color & 0xf80000)>>8 ) | (color & 0xfc00)>>5 | (color&0xf8)>>3);
	};

};

// 555模式的位圖
class Bitmap15 : public BitmapHi{
public:

	virtual Bitmap* ConvertFormat( int );

	inline virtual int  MakeColor( RGB color )
	{
		return (((color & 0xf80000)>>9 ) | (color & 0xf800)>>5 | (color&0xf8)>>3);
	};

};

// supports 24 bits color mode
class Bitmap24 : public Bitmap{
public:

	virtual void Blit( Bitmap* dest, int dx, int dy, int sx, int sy, int w, int h );
	void BlitInside24( int x, int y, int sx, int sy, int w, int h );
	void BlitOutside24( Bitmap24* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void BlitMask( Bitmap* dest, int x, int y, int sx, int sy, int w, int h );
	void BlitMasked24( Bitmap24* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void Clear( int l, int t, int w, int h, int color );
	virtual Bitmap* ConvertFormat( int );
	virtual DWORD GetPixel( int x, int y );
	virtual void PutPixel( int x, int y ); 
	virtual void SetColor( int color );
	virtual void SetColorKey( int color );
	
	inline virtual int MakeColor( RGB color ){
		return ( color & 0xffffff );
	};

	inline virtual int  GetR( int pixel ){
		return (( pixel >> 16 ) & 0xff );
	};

	inline virtual int  GetG( int pixel ){
		return (( pixel >> 8 ) & 0xff );
	};

	inline virtual int  GetB( int pixel ){
		return ( pixel & 0xff );
	};

};

// supports 32 bits color mode
class Bitmap32 : public Bitmap{
public:

	virtual void Blit( Bitmap* dest, int dx, int dy, int sx, int sy, int w, int h );
	void BlitInside32( int x, int y, int sx, int sy, int w, int h );
	void BlitOutside32( Bitmap32* dest, int x, int y, int sx, int sy, int w, int h );
	virtual void BlitMask( Bitmap* dest, int x, int y, int sx, int sy, int w, int h );
	void BlitMasked32( Bitmap32* dest, int x, int y, int sx, int sy, int w, int h );
	virtual Bitmap* ConvertFormat( int );
	virtual void Clear( int l, int t, int w, int h, int color );
	virtual DWORD GetPixel( int x, int y );
	virtual void PutPixel( int x, int y ); 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产精品亚洲综合| 成人免费视频网站在线观看| 国产精品影视天天线| av激情亚洲男人天堂| 3d成人h动漫网站入口| 国产精品久久久久久久久免费樱桃| 午夜精品一区在线观看| 国产精品一色哟哟哟| 日韩亚洲欧美一区二区三区| 亚洲精品视频在线观看免费| 国产精品白丝av| 精品国产一区二区三区忘忧草| 午夜精品一区二区三区三上悠亚| 色欧美乱欧美15图片| 日本一区二区三区久久久久久久久不 | 亚洲综合在线五月| 丁香婷婷综合色啪| 欧美激情在线看| 国产老妇另类xxxxx| 国产欧美日韩综合精品一区二区 | 奇米影视在线99精品| 在线一区二区视频| 亚洲天天做日日做天天谢日日欢| 国产精品羞羞答答xxdd| 久久久精品免费网站| 免费成人在线视频观看| 日韩欧美一级在线播放| 五月天激情小说综合| 欧美日韩国产成人在线91| 亚洲一二三专区| 5858s免费视频成人| 婷婷丁香久久五月婷婷| 91精品久久久久久蜜臀| 青青草国产精品97视觉盛宴| 91精品国产91久久综合桃花| 欧美a一区二区| 精品国产第一区二区三区观看体验| 久久精品噜噜噜成人88aⅴ| 欧美一级搡bbbb搡bbbb| 奇米影视一区二区三区| 久久综合视频网| 国产寡妇亲子伦一区二区| 国产日韩欧美综合在线| proumb性欧美在线观看| 一区二区三区毛片| 777亚洲妇女| 国产精品自拍在线| 最新国产成人在线观看| 欧美区在线观看| 精品在线亚洲视频| 国产精品水嫩水嫩| 欧美日韩精品免费观看视频| 久久精品国产亚洲5555| 精品理论电影在线观看| 国产成人av资源| 亚洲视频狠狠干| 欧美卡1卡2卡| 韩日av一区二区| 1024亚洲合集| 精品蜜桃在线看| 97久久久精品综合88久久| 日日骚欧美日韩| 欧美激情中文字幕| 91精品国产综合久久精品麻豆| 久久91精品久久久久久秒播| 亚洲青青青在线视频| 日韩午夜在线观看| 一本高清dvd不卡在线观看 | 亚洲综合久久av| 精品免费日韩av| 欧洲精品一区二区| 国产一区在线观看视频| 亚洲高清免费视频| 中文字幕欧美区| 欧美一区二区三区播放老司机| 成人午夜视频福利| 日韩av二区在线播放| 综合久久久久综合| 欧美精品一区二区高清在线观看| 色综合久久精品| 成人中文字幕合集| 乱一区二区av| 日韩福利电影在线| 亚洲一区二区三区不卡国产欧美| 久久久青草青青国产亚洲免观| 欧美揉bbbbb揉bbbbb| 99re热这里只有精品免费视频 | 日本91福利区| 亚洲精品自拍动漫在线| 国产网红主播福利一区二区| 5月丁香婷婷综合| 在线观看www91| 91一区二区在线| 风间由美一区二区三区在线观看| 免费久久99精品国产| 丝袜国产日韩另类美女| 一区二区三区四区不卡视频 | 亚洲综合自拍偷拍| 一色桃子久久精品亚洲| 久久久久久一二三区| 欧美大片在线观看一区二区| 欧美日韩视频在线第一区 | 国产成人鲁色资源国产91色综| 日韩电影在线看| 午夜精品福利一区二区三区av| 亚洲人成小说网站色在线 | 日本韩国精品在线| 91在线播放网址| 91亚洲午夜精品久久久久久| 成人丝袜视频网| av在线播放一区二区三区| 国产传媒久久文化传媒| 大尺度一区二区| 成人禁用看黄a在线| www.在线欧美| 一本色道亚洲精品aⅴ| 99国产精品久久久久| 99久久免费国产| 色婷婷综合久久久中文字幕| 欧美性猛交xxxx乱大交退制版| 在线观看91精品国产入口| 欧美日韩专区在线| 欧美电视剧免费全集观看| 欧美v国产在线一区二区三区| 精品福利一区二区三区| 久久综合九色综合97婷婷女人| 国产免费成人在线视频| 亚洲精品免费视频| 免费人成网站在线观看欧美高清| 精品在线播放午夜| 成人国产精品免费观看| 欧美偷拍一区二区| 日韩欧美国产精品| 中文字幕第一区第二区| 亚洲美女一区二区三区| 美女免费视频一区二区| 粉嫩久久99精品久久久久久夜| 在线视频综合导航| 2欧美一区二区三区在线观看视频| 国产精品女人毛片| 亚洲一区在线播放| 麻豆精品国产传媒mv男同| 成人午夜看片网址| 9191国产精品| 国产精品久久久久7777按摩 | 欧美日本一区二区三区| 久久久美女毛片| 亚洲一级二级在线| 国产乱码字幕精品高清av| 在线视频一区二区免费| 久久久久亚洲综合| 亚洲福利国产精品| 成人激情文学综合网| 91精品欧美久久久久久动漫 | 国产精品福利av| 琪琪久久久久日韩精品| www.亚洲人| 精品久久久久久久人人人人传媒| 国产精品国产a| 免费高清在线一区| 91精品福利在线| 亚洲国产精华液网站w| 蜜臀久久99精品久久久画质超高清 | 亚洲国产精品尤物yw在线观看| 国产一区二区三区免费播放| 欧美在线一区二区| 国产精品久久午夜| 国产一区在线看| 欧美一级理论性理论a| 亚洲欧美福利一区二区| 高潮精品一区videoshd| 日韩亚洲欧美一区二区三区| 一区二区三区日韩在线观看| 国产二区国产一区在线观看| 日韩一区二区不卡| 亚洲精品网站在线观看| av中文字幕一区| 国产日产欧美精品一区二区三区| 麻豆国产一区二区| 制服丝袜成人动漫| 亚洲一二三四区| 91福利视频网站| 亚洲精品国产a| 色综合久久综合网97色综合| 亚洲国产高清在线观看视频| 国产精品一二三四五| 久久久久久久久久久久久夜| 全部av―极品视觉盛宴亚洲| 欧美二区三区的天堂| 亚洲一级不卡视频| 欧美日韩综合在线免费观看| 亚洲综合网站在线观看| 在线观看网站黄不卡| 亚洲综合偷拍欧美一区色| 在线免费视频一区二区| 亚洲电影第三页| 制服.丝袜.亚洲.另类.中文 | 成人福利视频网站| 国产精品国产三级国产普通话99 | 亚洲国产日韩一级|