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

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

?? sdl_x11video.c

?? Simple DirectMedia Layer - Simple DirectMedia Layer 是一個跨平臺的多媒體庫設計用來提供快速圖形framebuffer和音頻驅動。應用MPEG為軟件
?? C
?? 第 1 頁 / 共 3 頁
字號:
			    case SDLK_CAPSLOCK:			    case SDLK_LCTRL:			    case SDLK_RCTRL:			    case SDLK_LSHIFT:			    case SDLK_RSHIFT:			    case SDLK_LALT:			    case SDLK_RALT:			    case SDLK_LMETA:			    case SDLK_RMETA:			    case SDLK_MODE:				break;			    default:				keys[i] = SDL_RELEASED;				break;			}		}	}	/* Map them both and go fullscreen, if requested */	if ( ! SDL_windowid ) {		XMapWindow(SDL_Display, SDL_Window);		XMapWindow(SDL_Display, WMwindow);		X11_WaitMapped(this, WMwindow);		if ( flags & SDL_FULLSCREEN ) {			screen->flags |= SDL_FULLSCREEN;			X11_EnterFullScreen(this);		} else {			screen->flags &= ~SDL_FULLSCREEN;		}	}	return(0);}static int X11_ResizeWindow(_THIS,			SDL_Surface *screen, int w, int h, Uint32 flags){	if ( ! SDL_windowid ) {		/* Resize the window manager window */		X11_SetSizeHints(this, w, h, flags);		current_w = w;		current_h = h;		XResizeWindow(SDL_Display, WMwindow, w, h);		/* Resize the fullscreen and display windows */		if ( flags & SDL_FULLSCREEN ) {			if ( screen->flags & SDL_FULLSCREEN ) {				X11_ResizeFullScreen(this);			} else {				screen->flags |= SDL_FULLSCREEN;				X11_EnterFullScreen(this);			}		} else {			if ( screen->flags & SDL_FULLSCREEN ) {				screen->flags &= ~SDL_FULLSCREEN;				X11_LeaveFullScreen(this);			}		}		XResizeWindow(SDL_Display, SDL_Window, w, h);	}	return(0);}SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current,				int width, int height, int bpp, Uint32 flags){	Uint32 saved_flags;	/* Lock the event thread, in multi-threading environments */	SDL_Lock_EventThread();	/* Check the combination of flags we were passed */	if ( flags & SDL_FULLSCREEN ) {		/* Clear fullscreen flag if not supported */		if ( SDL_windowid ) {			flags &= ~SDL_FULLSCREEN;		}	}	/* Flush any delayed updates */	XSync(GFX_Display, False);	/* Set up the X11 window */	saved_flags = current->flags;	if (SDL_Window && (saved_flags&SDL_OPENGL) == (flags&SDL_OPENGL)	    && bpp == current->format->BitsPerPixel) {		if (X11_ResizeWindow(this, current, width, height, flags) < 0) {			current = NULL;			goto done;		}	} else {		if (X11_CreateWindow(this,current,width,height,bpp,flags) < 0) {			current = NULL;			goto done;		}	}	/* Set up the new mode framebuffer */	if ( ((current->w != width) || (current->h != height)) ||             ((saved_flags&SDL_OPENGL) != (flags&SDL_OPENGL)) ) {		current->w = width;		current->h = height;		current->pitch = SDL_CalculatePitch(current);		X11_ResizeImage(this, current, flags);	}	current->flags |= (flags&(SDL_RESIZABLE|SDL_NOFRAME));  done:	/* Release the event thread */	XSync(SDL_Display, False);	SDL_Unlock_EventThread();	/* We're done! */	return(current);}static int X11_ToggleFullScreen(_THIS, int on){	Uint32 event_thread;	/* Don't switch if we don't own the window */	if ( SDL_windowid ) {		return(0);	}	/* Don't lock if we are the event thread */	event_thread = SDL_EventThreadID();	if ( event_thread && (SDL_ThreadID() == event_thread) ) {		event_thread = 0;	}	if ( event_thread ) {		SDL_Lock_EventThread();	}	if ( on ) {		this->screen->flags |= SDL_FULLSCREEN;		X11_EnterFullScreen(this);	} else {		this->screen->flags &= ~SDL_FULLSCREEN;		X11_LeaveFullScreen(this);	}	X11_RefreshDisplay(this);	if ( event_thread ) {		SDL_Unlock_EventThread();	}	SDL_ResetKeyboard();	return(1);}/* Update the current mouse state and position */static void X11_UpdateMouse(_THIS){	Window u1; int u2;	Window current_win;	int x, y;	unsigned int mask;	/* Lock the event thread, in multi-threading environments */	SDL_Lock_EventThread();	if ( XQueryPointer(SDL_Display, SDL_Window, &u1, &current_win,	                   &u2, &u2, &x, &y, &mask) ) {		if ( (x >= 0) && (x < SDL_VideoSurface->w) &&		     (y >= 0) && (y < SDL_VideoSurface->h) ) {			SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);			SDL_PrivateMouseMotion(0, 0, x, y);		} else {			SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);		}	}	SDL_Unlock_EventThread();}/* simple colour distance metric. Supposed to be better than a plain   Euclidian distance anyway. */#define COLOUR_FACTOR 3#define LIGHT_FACTOR 1#define COLOUR_DIST(r1, g1, b1, r2, g2, b2)				\	(COLOUR_FACTOR * (abs(r1 - r2) + abs(g1 - g2) + abs(b1 - b2))	\	 + LIGHT_FACTOR * abs(r1 + g1 + b1 - (r2 + g2 + b2)))static void allocate_nearest(_THIS, SDL_Color *colors,			     SDL_Color *want, int nwant){	/*	 * There is no way to know which ones to choose from, so we retrieve	 * the entire colormap and try the nearest possible, until we find one	 * that is shared.	 */	XColor all[256];	int i;	for(i = 0; i < 256; i++)		all[i].pixel = i;	/* 	 * XQueryColors sets the flags in the XColor struct, so we use	 * that to keep track of which colours are available	 */	XQueryColors(GFX_Display, SDL_XColorMap, all, 256);	for(i = 0; i < nwant; i++) {		XColor *c;		int j;		int best = 0;		int mindist = 0x7fffffff;		int ri = want[i].r;		int gi = want[i].g;		int bi = want[i].b;		for(j = 0; j < 256; j++) {			int rj, gj, bj, d2;			if(!all[j].flags)				continue;	/* unavailable colour cell */			rj = all[j].red >> 8;			gj = all[j].green >> 8;			bj = all[j].blue >> 8;			d2 = COLOUR_DIST(ri, gi, bi, rj, gj, bj);			if(d2 < mindist) {				mindist = d2;				best = j;			}		}		if(SDL_XPixels[best])			continue; /* already allocated, waste no more time */		c = all + best;		if(XAllocColor(GFX_Display, SDL_XColorMap, c)) {			/* got it */			colors[c->pixel].r = c->red >> 8;			colors[c->pixel].g = c->green >> 8;			colors[c->pixel].b = c->blue >> 8;			++SDL_XPixels[c->pixel];		} else {			/* 			 * The colour couldn't be allocated, probably being			 * owned as a r/w cell by another client. Flag it as			 * unavailable and try again. The termination of the			 * loop is guaranteed since at least black and white			 * are always there.			 */			c->flags = 0;			i--;		}	}}int X11_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors){	int nrej = 0;	/* Check to make sure we have a colormap allocated */	if ( SDL_XPixels == NULL ) {		return(0);	}	if ( (this->screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) {	        /* private writable colormap: just set the colours we need */	        XColor  *xcmap;		int i;	        xcmap = ALLOCA(ncolors*sizeof(*xcmap));		if(xcmap == NULL)		        return 0;		for ( i=0; i<ncolors; ++i ) {			xcmap[i].pixel = i + firstcolor;			xcmap[i].red   = (colors[i].r<<8)|colors[i].r;			xcmap[i].green = (colors[i].g<<8)|colors[i].g;			xcmap[i].blue  = (colors[i].b<<8)|colors[i].b;			xcmap[i].flags = (DoRed|DoGreen|DoBlue);		}		XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);		XSync(GFX_Display, False);		FREEA(xcmap);	} else {	        /*		 * Shared colormap: We only allocate read-only cells, which		 * increases the likelyhood of colour sharing with other		 * clients. The pixel values will almost certainly be		 * different from the requested ones, so the user has to		 * walk the colormap and see which index got what colour.		 *		 * We can work directly with the logical palette since it		 * has already been set when we get here.		 */		SDL_Color *want, *reject;	        unsigned long *freelist;		int i;		int nfree = 0;		int nc = this->screen->format->palette->ncolors;	        colors = this->screen->format->palette->colors;		freelist = ALLOCA(nc * sizeof(*freelist));		/* make sure multiple allocations of the same cell are freed */	        for(i = 0; i < ncolors; i++) {		        int pixel = firstcolor + i;		        while(SDL_XPixels[pixel]) {			        freelist[nfree++] = pixel;				--SDL_XPixels[pixel];			}		}		XFreeColors(GFX_Display, SDL_XColorMap, freelist, nfree, 0);		FREEA(freelist);		want = ALLOCA(ncolors * sizeof(SDL_Color));		reject = ALLOCA(ncolors * sizeof(SDL_Color));		memcpy(want, colors + firstcolor, ncolors * sizeof(SDL_Color));		/* make sure the user isn't fooled by her own wishes		   (black is safe, always available in the default colormap) */		memset(colors + firstcolor, 0, ncolors * sizeof(SDL_Color));		/* now try to allocate the colours */		for(i = 0; i < ncolors; i++) {		        XColor col;			col.red = want[i].r << 8;			col.green = want[i].g << 8;			col.blue = want[i].b << 8;			col.flags = DoRed | DoGreen | DoBlue;			if(XAllocColor(GFX_Display, SDL_XColorMap, &col)) {			        /* We got the colour, or at least the nearest				   the hardware could get. */			        colors[col.pixel].r = col.red >> 8;				colors[col.pixel].g = col.green >> 8;				colors[col.pixel].b = col.blue >> 8;				++SDL_XPixels[col.pixel];			} else {				/*				 * no more free cells, add it to the list				 * of rejected colours				 */				reject[nrej++] = want[i];			}		}		if(nrej)			allocate_nearest(this, colors, reject, nrej);		FREEA(reject);		FREEA(want);	}	return nrej == 0;}int X11_SetGammaRamp(_THIS, Uint16 *ramp){	int i, ncolors;	XColor xcmap[256];	/* See if actually setting the gamma is supported */	if ( SDL_Visual->class != DirectColor ) {	    SDL_SetError("Gamma correction not supported on this visual");	    return(-1);	}	/* Calculate the appropriate palette for the given gamma ramp */	ncolors = SDL_Visual->map_entries;	for ( i=0; i<ncolors; ++i ) {		Uint8 c = (256 * i / ncolors);		xcmap[i].pixel = SDL_MapRGB(this->screen->format, c, c, c);		xcmap[i].red   = ramp[0*256+c];		xcmap[i].green = ramp[1*256+c];		xcmap[i].blue  = ramp[2*256+c];		xcmap[i].flags = (DoRed|DoGreen|DoBlue);	}	XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);	XSync(GFX_Display, False);	return(0);}/* Note:  If we are terminated, this could be called in the middle of   another SDL video routine -- notably UpdateRects.*/void X11_VideoQuit(_THIS){	/* Shutdown everything that's still up */	/* The event thread should be done, so we can touch SDL_Display */	if ( SDL_Display != NULL ) {		/* Flush any delayed updates */		XSync(GFX_Display, False);		/* Start shutting down the windows */		X11_DestroyImage(this, this->screen);		X11_DestroyWindow(this, this->screen);		X11_FreeVideoModes(this);		if ( SDL_XColorMap != SDL_DisplayColormap ) {			XFreeColormap(SDL_Display, SDL_XColorMap);		}		if ( SDL_iconcolors ) {			unsigned long pixel;			Colormap dcmap = DefaultColormap(SDL_Display,							 SDL_Screen);			for(pixel = 0; pixel < 256; ++pixel) {				while(SDL_iconcolors[pixel] > 0) {					XFreeColors(GFX_Display,						    dcmap, &pixel, 1, 0);					--SDL_iconcolors[pixel];				}			}			free(SDL_iconcolors);			SDL_iconcolors = NULL;		} 		/* Restore gamma settings if they've changed */		if ( SDL_GetAppState() & SDL_APPACTIVE ) {			X11_SwapVidModeGamma(this);		}		/* Free that blank cursor */		if ( SDL_BlankCursor != NULL ) {			this->FreeWMCursor(this, SDL_BlankCursor);			SDL_BlankCursor = NULL;		}		/* Close the X11 graphics connection */		if ( GFX_Display != NULL ) {			XCloseDisplay(GFX_Display);			GFX_Display = NULL;		}		/* Close the X11 display connection */		XCloseDisplay(SDL_Display);		SDL_Display = NULL;		/* Reset the X11 error handlers */		if ( XIO_handler ) {			XSetIOErrorHandler(XIO_handler);		}		if ( X_handler ) {			XSetErrorHandler(X_handler);		}		/* Unload GL library after X11 shuts down */		X11_GL_UnloadLibrary(this);	}	if ( this->screen && (this->screen->flags & SDL_HWSURFACE) ) {		/* Direct screen access, no memory buffer */		this->screen->pixels = NULL;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区黑丝| 久久精品国产久精国产| 欧美tickling网站挠脚心| 91免费观看视频| 国产美女主播视频一区| 激情综合色丁香一区二区| 亚洲一区中文日韩| 亚洲欧美偷拍卡通变态| 国产精品国产三级国产普通话99 | 99久久er热在这里只有精品15| 国产精品一二三| 91精品蜜臀在线一区尤物| 欧美熟乱第一页| 欧美日韩国产系列| www国产成人免费观看视频 深夜成人网| 日韩一卡二卡三卡国产欧美| 欧美xingq一区二区| 亚洲成在人线免费| 午夜精品视频在线观看| 精彩视频一区二区| 精品国产乱码久久久久久影片| 精品成人一区二区| 免费视频最近日韩| 国产精品18久久久久久久久| 欧美一区在线视频| 欧美激情在线一区二区| 伊人色综合久久天天人手人婷| 午夜精品福利一区二区蜜股av| 在线观看免费亚洲| 日韩欧美国产三级| 国产精品你懂的| 爽爽淫人综合网网站| 国产成人av一区二区三区在线观看| 成人小视频在线| 欧美日韩亚洲另类| 日本一区二区三区电影| 亚洲专区一二三| 欧美日韩一区小说| 欧美aaa在线| 国产午夜亚洲精品午夜鲁丝片 | 成人午夜又粗又硬又大| 久久精品欧美日韩精品| 国产suv精品一区二区6| 日韩亚洲国产中文字幕欧美| 蜜臀av一区二区| 在线一区二区三区四区五区| 精品久久久久久无| 国产精品一区二区免费不卡| 国产精品素人一区二区| 91麻豆免费视频| 亚洲高清在线视频| 色久综合一二码| 日韩在线一二三区| 国产亚洲精品久| 91行情网站电视在线观看高清版| 亚洲一区二区三区四区在线观看| 欧美一区二区三区播放老司机| 国产一区二区三区在线观看免费| 国产精品黄色在线观看| 欧美日韩高清影院| 国产精品亚洲一区二区三区在线| 亚洲精品成人天堂一二三| 欧美成人精品1314www| 成人激情小说网站| 欧美韩日一区二区三区| 91成人在线精品| 精品一区二区在线免费观看| 亚洲天堂精品在线观看| 成人免费视频国产在线观看| 亚洲国产人成综合网站| 久久天天做天天爱综合色| 欧美体内she精视频| 国产一区二区三区四区五区入口 | 97超碰欧美中文字幕| 麻豆成人久久精品二区三区小说| 国产精品你懂的| 精品日韩欧美一区二区| 色94色欧美sute亚洲13| 国产一区999| 日本亚洲一区二区| 日韩欧美一区二区视频| 色素色在线综合| 一片黄亚洲嫩模| 91网址在线看| 国产一区二区三区黄视频| 一区二区三区免费网站| 久久久久久一级片| k8久久久一区二区三区| 国产精品久久久久久久久晋中| 5858s免费视频成人| 色综合久久九月婷婷色综合| 韩国精品久久久| 久久精品综合网| 日韩一区二区在线看片| 欧美视频日韩视频| 成人av在线电影| 大美女一区二区三区| 久久精品国产免费看久久精品| 亚洲一区在线观看视频| 中文字幕在线不卡| 欧美三级在线视频| 91蜜桃在线免费视频| 国产寡妇亲子伦一区二区| 精品伊人久久久久7777人| 老司机午夜精品| 美女视频第一区二区三区免费观看网站| 亚洲欧美一区二区久久 | 久久综合狠狠综合久久综合88| 欧美理论电影在线| 国产一区二区三区免费| 久久99久久99| 精品一区二区综合| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品久久久久久久久免费丝袜| 精品久久久久久无| 久久蜜桃av一区二区天堂 | 久久成人18免费观看| 日本午夜精品一区二区三区电影| 婷婷激情综合网| 男人的j进女人的j一区| 国内成人免费视频| 懂色中文一区二区在线播放| 国产精品一区二区你懂的| 成人综合日日夜夜| 99国产精品久| 欧美日韩一本到| 日韩视频一区二区三区| 久久嫩草精品久久久久| 国产精品视频看| 亚洲福利视频一区| 久久99在线观看| 国产精品一二三四五| 一本到高清视频免费精品| 欧美羞羞免费网站| 日韩视频免费观看高清完整版在线观看 | 久久99国产精品久久99果冻传媒| 乱一区二区av| www.欧美色图| 欧美久久高跟鞋激| 久久一区二区三区国产精品| 亚洲欧洲日韩综合一区二区| 亚洲成人自拍偷拍| 国产成人av自拍| 欧美日韩成人高清| 国产日产精品1区| 一区二区三区高清不卡| 久久国产成人午夜av影院| 99re8在线精品视频免费播放| 欧美伦理影视网| 国产精品三级av在线播放| 午夜精品久久一牛影视| 国产白丝网站精品污在线入口| 欧美在线观看视频在线| 久久综合色综合88| 午夜一区二区三区视频| 菠萝蜜视频在线观看一区| 在线不卡一区二区| 中文字幕在线不卡一区| 国产自产v一区二区三区c| 欧洲av一区二区嗯嗯嗯啊| 久久亚洲二区三区| 日日摸夜夜添夜夜添国产精品 | 欧美日韩不卡视频| 国产精品欧美一级免费| 青青草视频一区| 色天天综合久久久久综合片| 久久久久久免费| 日韩和欧美的一区| 一本久道中文字幕精品亚洲嫩| 久久伊人蜜桃av一区二区| 亚洲一区二区三区在线看| 丁香一区二区三区| 欧美一级国产精品| 亚洲国产精品一区二区久久恐怖片| 国产.欧美.日韩| 精品日韩成人av| 日本成人在线视频网站| 在线观看亚洲专区| 自拍偷拍国产亚洲| 成人三级在线视频| 久久久精品人体av艺术| 极品尤物av久久免费看| 日韩欧美视频在线| 美女精品自拍一二三四| 欧美一区二区三区视频免费| 午夜精品爽啪视频| 欧美日韩国产免费| 三级久久三级久久久| 69堂成人精品免费视频| 亚洲成av人片一区二区梦乃| 91视视频在线观看入口直接观看www| 久久亚洲精品国产精品紫薇| 韩国理伦片一区二区三区在线播放| 制服.丝袜.亚洲.中文.综合| 性欧美疯狂xxxxbbbb| 7777精品伊人久久久大香线蕉完整版 | 久久久精品综合| 国产成人在线影院| 国产日韩视频一区二区三区| 久久99精品久久久久久久久久久久|