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

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

?? sdl_video.c

?? Simple DirectMedia Layer - Simple DirectMedia Layer 是一個(gè)跨平臺的多媒體庫設(shè)計(jì)用來提供快速圖形framebuffer和音頻驅(qū)動(dòng)。應(yīng)用MPEG為軟件
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*    SDL - Simple DirectMedia Layer    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga    This library is free software; you can redistribute it and/or    modify it under the terms of the GNU Library General Public    License as published by the Free Software Foundation; either    version 2 of the License, or (at your option) any later version.    This library is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    Library General Public License for more details.    You should have received a copy of the GNU Library General Public    License along with this library; if not, write to the Free    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    Sam Lantinga    slouken@libsdl.org*/#ifdef SAVE_RCSIDstatic char rcsid = "@(#) $Id: SDL_video.c,v 1.32 2002/10/05 16:50:56 slouken Exp $";#endif/* The high-level video driver subsystem */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "SDL.h"#include "SDL_error.h"#include "SDL_video.h"#include "SDL_events.h"#include "SDL_mutex.h"#include "SDL_sysvideo.h"#include "SDL_sysevents.h"#include "SDL_blit.h"#include "SDL_pixels_c.h"#include "SDL_events_c.h"#include "SDL_cursor_c.h"/* Available video drivers */static VideoBootStrap *bootstrap[] = {#ifdef ENABLE_X11	&X11_bootstrap,#endif#ifdef ENABLE_DGA	&DGA_bootstrap,#endif#ifdef ENABLE_NANOX	&NX_bootstrap,#endif#ifdef ENABLE_FBCON	&FBCON_bootstrap,#endif#ifdef ENABLE_DIRECTFB	&DirectFB_bootstrap,#endif#ifdef ENABLE_PS2GS	&PS2GS_bootstrap,#endif#ifdef ENABLE_GGI	&GGI_bootstrap,#endif#ifdef ENABLE_VGL	&VGL_bootstrap,#endif#ifdef ENABLE_SVGALIB	&SVGALIB_bootstrap,#endif#ifdef ENABLE_AALIB    &AALIB_bootstrap,#endif#ifdef ENABLE_DIRECTX	&DIRECTX_bootstrap,#endif#ifdef ENABLE_WINDIB	&WINDIB_bootstrap,#endif#ifdef ENABLE_BWINDOW	&BWINDOW_bootstrap,#endif#ifdef ENABLE_TOOLBOX	&TOOLBOX_bootstrap,#endif#ifdef ENABLE_DRAWSPROCKET	&DSp_bootstrap,#endif#ifdef ENABLE_QUARTZ	&QZ_bootstrap,#endif#ifdef ENABLE_CYBERGRAPHICS	&CGX_bootstrap,#endif#ifdef ENABLE_PHOTON	&ph_bootstrap,#endif#ifdef ENABLE_EPOC	&EPOC_bootstrap,#endif#ifdef ENABLE_DUMMYVIDEO	&DUMMY_bootstrap,#endif#ifdef ENABLE_XBIOS	&XBIOS_bootstrap,#endif#ifdef ENABLE_GEM	&GEM_bootstrap,#endif#ifdef ENABLE_QTOPIA	&Qtopia_bootstrap,#endif#ifdef ENABLE_PICOGUI	&PG_bootstrap,#endif#ifdef ENABLE_DC	&DC_bootstrap,#endif	NULL};SDL_VideoDevice *current_video = NULL;/* Various local functions */int SDL_VideoInit(const char *driver_name, Uint32 flags);void SDL_VideoQuit(void);void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects);static SDL_GrabMode SDL_WM_GrabInputOff(void);#ifdef HAVE_OPENGLstatic int lock_count = 0;#endif/* * Initialize the video and event subsystems -- determine native pixel format */int SDL_VideoInit (const char *driver_name, Uint32 flags){	SDL_VideoDevice *video;	int index;	int i;	SDL_PixelFormat vformat;	Uint32 video_flags;	/* Toggle the event thread flags, based on OS requirements */#if defined(MUST_THREAD_EVENTS)	flags |= SDL_INIT_EVENTTHREAD;#elif defined(CANT_THREAD_EVENTS)	if ( (flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) {		SDL_SetError("OS doesn't support threaded events");		return(-1);	}#endif	/* Check to make sure we don't overwrite 'current_video' */	if ( current_video != NULL ) {		SDL_VideoQuit();	}	/* Select the proper video driver */	index = 0;	video = NULL;	if ( driver_name != NULL ) {#if 0	/* This will be replaced with a better driver selection API */		if ( strrchr(driver_name, ':') != NULL ) {			index = atoi(strrchr(driver_name, ':')+1);		}#endif		for ( i=0; bootstrap[i]; ++i ) {			if ( strncmp(bootstrap[i]->name, driver_name,			             strlen(bootstrap[i]->name)) == 0 ) {				if ( bootstrap[i]->available() ) {					video = bootstrap[i]->create(index);					break;				}			}		}	} else {		for ( i=0; bootstrap[i]; ++i ) {			if ( bootstrap[i]->available() ) {				video = bootstrap[i]->create(index);				if ( video != NULL ) {					break;				}			}		}	}	if ( video == NULL ) {		SDL_SetError("No available video device");		return(-1);	}	current_video = video;	current_video->name = bootstrap[i]->name;	/* Do some basic variable initialization */	video->screen = NULL;	video->shadow = NULL;	video->visible = NULL;	video->physpal = NULL;	video->gammacols = NULL;	video->gamma = NULL;	video->wm_title = NULL;	video->wm_icon  = NULL;	video->offset_x = 0;	video->offset_y = 0;	memset(&video->info, 0, (sizeof video->info));	/* Set some very sane GL defaults */	video->gl_config.driver_loaded = 0;	video->gl_config.dll_handle = NULL;	video->gl_config.red_size = 5;#if 1 /* This seems to work on more video cards, as a default */	video->gl_config.green_size = 5;#else	video->gl_config.green_size = 6;#endif	video->gl_config.blue_size = 5;	video->gl_config.alpha_size = 0;	video->gl_config.buffer_size = 0;	video->gl_config.depth_size = 16;	video->gl_config.stencil_size = 0;	video->gl_config.double_buffer = 1;	video->gl_config.accum_red_size = 0;	video->gl_config.accum_green_size = 0;	video->gl_config.accum_blue_size = 0;	video->gl_config.accum_alpha_size = 0;	video->gl_config.stereo = 0;		/* Initialize the video subsystem */	memset(&vformat, 0, sizeof(vformat));	if ( video->VideoInit(video, &vformat) < 0 ) {		SDL_VideoQuit();		return(-1);	}	/* Create a zero sized video surface of the appropriate format */	video_flags = SDL_SWSURFACE;	SDL_VideoSurface = SDL_CreateRGBSurface(video_flags, 0, 0,				vformat.BitsPerPixel,				vformat.Rmask, vformat.Gmask, vformat.Bmask, 0);	if ( SDL_VideoSurface == NULL ) {		SDL_VideoQuit();		return(-1);	}	SDL_PublicSurface = NULL;	/* Until SDL_SetVideoMode() */#if 0 /* Don't change the current palette - may be used by other programs.       * The application can't do anything with the display surface until       * a video mode has been set anyway. :)       */	/* If we have a palettized surface, create a default palette */	if ( SDL_VideoSurface->format->palette ) {	        SDL_PixelFormat *vf = SDL_VideoSurface->format;		SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);		video->SetColors(video,				 0, vf->palette->ncolors, vf->palette->colors);	}#endif	video->info.vfmt = SDL_VideoSurface->format;	/* Start the event loop */	if ( SDL_StartEventLoop(flags) < 0 ) {		SDL_VideoQuit();		return(-1);	}	SDL_CursorInit(flags & SDL_INIT_EVENTTHREAD);	/* We're ready to go! */	return(0);}char *SDL_VideoDriverName(char *namebuf, int maxlen){	if ( current_video != NULL ) {		strncpy(namebuf, current_video->name, maxlen-1);		namebuf[maxlen-1] = '\0';		return(namebuf);	}	return(NULL);}/* * Get the current display surface */SDL_Surface *SDL_GetVideoSurface(void){	SDL_Surface *visible;	visible = NULL;	if ( current_video ) {		visible = current_video->visible;	}	return(visible);}/* * Get the current information about the video hardware */const SDL_VideoInfo *SDL_GetVideoInfo(void){	const SDL_VideoInfo *info;	info = NULL;	if ( current_video ) {		info = &current_video->info;	}	return(info);}/* * Return a pointer to an array of available screen dimensions for the * given format, sorted largest to smallest.  Returns NULL if there are * no dimensions available for a particular format, or (SDL_Rect **)-1 * if any dimension is okay for the given format.  If 'format' is NULL, * the mode list will be for the format given by SDL_GetVideoInfo()->vfmt */SDL_Rect ** SDL_ListModes (SDL_PixelFormat *format, Uint32 flags){	SDL_VideoDevice *video = current_video;	SDL_VideoDevice *this  = current_video;	SDL_Rect **modes;	modes = NULL;	if ( SDL_VideoSurface ) {		if ( format == NULL ) {			format = SDL_VideoSurface->format;		}		modes = video->ListModes(this, format, flags);	}	return(modes);}/* * Check to see if a particular video mode is supported. * It returns 0 if the requested mode is not supported under any bit depth, * or returns the bits-per-pixel of the closest available mode with the * given width and height.  If this bits-per-pixel is different from the * one used when setting the video mode, SDL_SetVideoMode() will succeed, * but will emulate the requested bits-per-pixel with a shadow surface. */static Uint8 SDL_closest_depths[4][8] = {	/* 8 bit closest depth ordering */	{ 0, 8, 16, 15, 32, 24, 0, 0 },	/* 15,16 bit closest depth ordering */	{ 0, 16, 15, 32, 24, 8, 0, 0 },	/* 24 bit closest depth ordering */	{ 0, 24, 32, 16, 15, 8, 0, 0 },	/* 32 bit closest depth ordering */	{ 0, 32, 16, 15, 24, 8, 0, 0 }};int SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags) {	int table, b, i;	int supported;	SDL_PixelFormat format;	SDL_Rect **sizes;	/* Currently 1 and 4 bpp are not supported */	if ( bpp < 8 || bpp > 32 ) {		return(0);	}	if ( (width <= 0) || (height <= 0) ) {		return(0);	}	/* Search through the list valid of modes */	memset(&format, 0, sizeof(format));	supported = 0;	table = ((bpp+7)/8)-1;	SDL_closest_depths[table][0] = bpp;	SDL_closest_depths[table][7] = 0;	for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {		format.BitsPerPixel = SDL_closest_depths[table][b];		sizes = SDL_ListModes(&format, flags);		if ( sizes == (SDL_Rect **)0 ) {			/* No sizes supported at this bit-depth */			continue;		} else #ifdef macintosh /* MPW optimization bug? */		if ( (sizes == (SDL_Rect **)0xFFFFFFFF) ||#else		if ( (sizes == (SDL_Rect **)-1) ||#endif		     current_video->handles_any_size ) {			/* Any size supported at this bit-depth */			supported = 1;			continue;		} else		for ( i=0; sizes[i]; ++i ) {			if ((sizes[i]->w == width) && (sizes[i]->h == height)) {				supported = 1;				break;			}		}	}	if ( supported ) {		--b;		return(SDL_closest_depths[table][b]);	} else {		return(0);	}}/* * Get the closest non-emulated video mode to the one requested */static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags){	int table, b, i;	int supported;	int native_bpp;	SDL_PixelFormat format;	SDL_Rect **sizes;	/* Check parameters */	if ( *BitsPerPixel < 8 || *BitsPerPixel > 32 ) {		SDL_SetError("Invalid bits per pixel (range is {8...32})");		return(0);	}	if ((*w <= 0) || (*h <= 0)) {		SDL_SetError("Invalid width or height");		return(0);	}	/* Try the original video mode, get the closest depth */	native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags);	if ( native_bpp == *BitsPerPixel ) {		return(1);	}	if ( native_bpp > 0 ) {		*BitsPerPixel = native_bpp;		return(1);	}	/* No exact size match at any depth, look for closest match */	memset(&format, 0, sizeof(format));	supported = 0;	table = ((*BitsPerPixel+7)/8)-1;	SDL_closest_depths[table][0] = *BitsPerPixel;	SDL_closest_depths[table][7] = SDL_VideoSurface->format->BitsPerPixel;	for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {		format.BitsPerPixel = SDL_closest_depths[table][b];		sizes = SDL_ListModes(&format, flags);		if ( sizes == (SDL_Rect **)0 ) {			/* No sizes supported at this bit-depth */			continue;		}		for ( i=0; sizes[i]; ++i ) {			if ((sizes[i]->w < *w) || (sizes[i]->h < *h)) {				if ( i > 0 ) {					--i;					*w = sizes[i]->w;					*h = sizes[i]->h;					*BitsPerPixel = SDL_closest_depths[table][b];					supported = 1;				} else {					/* Largest mode too small... */;				}				break;			}		}		if ( (i > 0) && ! sizes[i] ) {			/* The smallest mode was larger than requested, OK */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区成人| 一级做a爱片久久| 日韩一级免费观看| 欧美日韩一区二区在线视频| 一本大道综合伊人精品热热| 本田岬高潮一区二区三区| 国产a区久久久| 成人av免费在线| jlzzjlzz亚洲女人18| 99天天综合性| 95精品视频在线| 91成人免费网站| 欧美色区777第一页| 7777精品伊人久久久大香线蕉的| 91精品国产色综合久久久蜜香臀| 欧美另类高清zo欧美| 欧美高清激情brazzers| 制服丝袜国产精品| 精品国产青草久久久久福利| 久久精品综合网| 中文字幕一区在线观看| 一区二区三区欧美久久| 天天爽夜夜爽夜夜爽精品视频| 日本亚洲免费观看| 国产一区二区电影| 本田岬高潮一区二区三区| 色噜噜夜夜夜综合网| 欧美日韩免费不卡视频一区二区三区| 欧美日韩你懂得| 精品国产区一区| 中文字幕 久热精品 视频在线| 日韩一区日韩二区| 日日摸夜夜添夜夜添精品视频| 免费成人av在线| 久久久久久毛片| 国产精品久久久一本精品 | 91精品久久久久久久久99蜜臂| 欧美丰满少妇xxxbbb| 久久综合久久综合久久| 中文字幕在线不卡| 日韩激情中文字幕| 国产激情一区二区三区| 色呦呦一区二区三区| 91精品免费观看| 国产精品视频九色porn| 亚洲第一搞黄网站| 国产成人精品www牛牛影视| 99国产欧美另类久久久精品 | 久久日韩粉嫩一区二区三区| 国产精品久久久久久久岛一牛影视| 亚洲午夜在线电影| 国产一区二区日韩精品| 色婷婷av一区| 欧美精品一区二区在线播放 | 成人动漫在线一区| 欧美人动与zoxxxx乱| 中文字幕+乱码+中文字幕一区| 亚洲成人中文在线| 成人av中文字幕| 日韩无一区二区| 亚洲精品一二三| 国产精品亚洲第一区在线暖暖韩国| 在线观看亚洲a| 欧美极品美女视频| 男男gaygay亚洲| 欧美在线一区二区| 国产精品污www在线观看| 欧美一区二区成人6969| 国产精品麻豆视频| 蜜桃久久av一区| 91日韩精品一区| 久久久久国产精品麻豆ai换脸 | 国产精品主播直播| 欧美日韩激情一区二区| 国产精品麻豆视频| 国内外成人在线视频| 欧美精品久久99| 亚洲激情网站免费观看| 成人午夜伦理影院| 欧美精品一区二区三区在线| 日韩不卡一区二区| 在线免费观看日韩欧美| 综合电影一区二区三区| 成人中文字幕在线| 国产午夜精品久久久久久免费视| 日本va欧美va瓶| 欧美日本免费一区二区三区| 亚洲激情图片qvod| 91在线丨porny丨国产| 国产精品污www在线观看| 精品一区免费av| 欧美zozo另类异族| 美国av一区二区| 欧美一区二区三区不卡| 午夜激情久久久| 91精品福利视频| 一区二区三区久久久| 91小视频免费观看| 中文字幕一区二区三区在线不卡 | 亚洲黄色小视频| 91香蕉视频污在线| 亚洲三级小视频| 一本色道久久综合精品竹菊| 国产精品久久久久影院亚瑟| 丁香婷婷综合网| 欧美韩国日本不卡| av在线不卡电影| 亚洲色图欧美在线| 91久久一区二区| 亚洲国产成人av好男人在线观看| 欧美性极品少妇| 手机精品视频在线观看| 欧美一卡二卡在线观看| 免费观看成人av| 久久久www成人免费毛片麻豆| 国产成人av影院| 17c精品麻豆一区二区免费| 色悠悠久久综合| 亚洲成人动漫在线观看| 日韩一区二区在线看| 久久精品国产第一区二区三区| www国产成人免费观看视频 深夜成人网| 韩国欧美国产1区| 亚洲国产精品高清| 成人av先锋影音| 亚洲一区在线视频| 欧美一区二区三区电影| 国产精品亚洲一区二区三区妖精 | 99这里只有久久精品视频| 亚洲三级在线看| 欧美电影影音先锋| 国产美女在线观看一区| 国产精品三级在线观看| 在线视频你懂得一区二区三区| 肉色丝袜一区二区| 久久蜜桃av一区二区天堂| 91麻豆国产福利精品| 三级在线观看一区二区| 国产三级精品视频| 在线视频一区二区三| 久久99国产精品久久| 中文字幕在线不卡| 欧美肥胖老妇做爰| 成人午夜免费av| 日韩专区一卡二卡| 欧美韩国日本综合| 欧美高清视频www夜色资源网| 国产精品一级在线| 亚洲国产wwwccc36天堂| 久久九九全国免费| 欧美视频中文字幕| 国产成都精品91一区二区三| 亚洲一二三区在线观看| 久久精品在线免费观看| 欧美性生交片4| 国产91精品一区二区| 天堂va蜜桃一区二区三区漫画版| 国产性色一区二区| 欧美日韩一区二区三区四区| 国产精品 欧美精品| 亚洲成人免费在线观看| 亚洲国产精品成人久久综合一区| 欧洲另类一二三四区| 懂色av一区二区夜夜嗨| 日韩福利电影在线观看| 18成人在线视频| 久久久精品tv| 在线综合视频播放| 色婷婷av一区二区三区大白胸| 国内精品不卡在线| 日韩制服丝袜av| 一区二区三区自拍| 国产三级三级三级精品8ⅰ区| 欧美人xxxx| 一本色道亚洲精品aⅴ| 国产成人av一区| 久久不见久久见免费视频7| 亚洲一区二区av在线| 中文字幕亚洲欧美在线不卡| 久久久久青草大香线综合精品| 91精品国产免费| 欧美午夜影院一区| 91蜜桃在线免费视频| 国产suv精品一区二区三区| 久久99久久精品欧美| 日韩国产在线观看一区| 一区二区三区久久| 亚洲色图制服丝袜| 国产精品精品国产色婷婷| 久久婷婷国产综合精品青草| 日韩欧美在线网站| 51精品国自产在线| 欧美日韩精品欧美日韩精品一综合| 91免费观看国产| 91在线精品一区二区| eeuss影院一区二区三区| 风间由美性色一区二区三区| 国产真实精品久久二三区| 久久精品国产一区二区三| 日韩激情一二三区|