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

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

?? sdl_x11video.c

?? Simple DirectMedia Layer - Simple DirectMedia Layer 是一個(gè)跨平臺(tái)的多媒體庫設(shè)計(jì)用來提供快速圖形framebuffer和音頻驅(qū)動(dòng)。應(yīng)用MPEG為軟件
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/*    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_x11video.c,v 1.13 2002/09/30 00:35:25 slouken Exp $";#endif/* X11 based SDL video driver implementation.   Note:  This implementation does not currently need X11 thread locking,          since the event thread uses a separate X connection and any          additional locking necessary is handled internally.  However,          if full locking is neccessary, take a look at XInitThreads().*/#include <stdlib.h>#include <stdio.h>#include <unistd.h>#include <string.h>#include <sys/ioctl.h>#ifdef MTRR_SUPPORT#include <asm/mtrr.h>#include <sys/fcntl.h>#endif#ifdef HAVE_ALLOCA_H#include <alloca.h>#endif#ifdef HAVE_ALLOCA#define ALLOCA(n) ((void*)alloca(n))#define FREEA(p)#else#define ALLOCA(n) malloc(n)#define FREEA(p) free(p)#endif#include "SDL.h"#include "SDL_error.h"#include "SDL_timer.h"#include "SDL_thread.h"#include "SDL_video.h"#include "SDL_mouse.h"#include "SDL_endian.h"#include "SDL_sysvideo.h"#include "SDL_pixels_c.h"#include "SDL_events_c.h"#include "SDL_x11video.h"#include "SDL_x11wm_c.h"#include "SDL_x11mouse_c.h"#include "SDL_x11events_c.h"#include "SDL_x11modes_c.h"#include "SDL_x11image_c.h"#include "SDL_x11yuv_c.h"#include "SDL_x11gl_c.h"#include "SDL_x11gamma_c.h"#include "blank_cursor.h"/* Initialization/Query functions */static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat);static SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);static int X11_ToggleFullScreen(_THIS, int on);static void X11_UpdateMouse(_THIS);static int X11_SetColors(_THIS, int firstcolor, int ncolors,			 SDL_Color *colors);static int X11_SetGammaRamp(_THIS, Uint16 *ramp);static void X11_VideoQuit(_THIS);/* X11 driver bootstrap functions */static int X11_Available(void){	Display *display;	display = XOpenDisplay(NULL);	if ( display != NULL ) {		XCloseDisplay(display);	}	return(display != NULL);}static void X11_DeleteDevice(SDL_VideoDevice *device){	if ( device ) {		if ( device->hidden ) {			free(device->hidden);		}		if ( device->gl_data ) {			free(device->gl_data);		}		free(device);	}}static SDL_VideoDevice *X11_CreateDevice(int devindex){	SDL_VideoDevice *device;	/* Initialize all variables that we clean on shutdown */	device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice));	if ( device ) {		memset(device, 0, (sizeof *device));		device->hidden = (struct SDL_PrivateVideoData *)				malloc((sizeof *device->hidden));		device->gl_data = (struct SDL_PrivateGLData *)				malloc((sizeof *device->gl_data));	}	if ( (device == NULL) || (device->hidden == NULL) ||	                         (device->gl_data == NULL) ) {		SDL_OutOfMemory();		X11_DeleteDevice(device);		return(0);	}	memset(device->hidden, 0, (sizeof *device->hidden));	memset(device->gl_data, 0, (sizeof *device->gl_data));	/* Set the driver flags */	device->handles_any_size = 1;	/* Set the function pointers */	device->VideoInit = X11_VideoInit;	device->ListModes = X11_ListModes;	device->SetVideoMode = X11_SetVideoMode;	device->ToggleFullScreen = X11_ToggleFullScreen;	device->UpdateMouse = X11_UpdateMouse;#ifdef XFREE86_XV	device->CreateYUVOverlay = X11_CreateYUVOverlay;#endif	device->SetColors = X11_SetColors;	device->UpdateRects = NULL;	device->VideoQuit = X11_VideoQuit;	device->AllocHWSurface = X11_AllocHWSurface;	device->CheckHWBlit = NULL;	device->FillHWRect = NULL;	device->SetHWColorKey = NULL;	device->SetHWAlpha = NULL;	device->LockHWSurface = X11_LockHWSurface;	device->UnlockHWSurface = X11_UnlockHWSurface;	device->FlipHWSurface = X11_FlipHWSurface;	device->FreeHWSurface = X11_FreeHWSurface;	device->SetGamma = X11_SetVidModeGamma;	device->GetGamma = X11_GetVidModeGamma;	device->SetGammaRamp = X11_SetGammaRamp;	device->GetGammaRamp = NULL;#ifdef HAVE_OPENGL	device->GL_LoadLibrary = X11_GL_LoadLibrary;	device->GL_GetProcAddress = X11_GL_GetProcAddress;	device->GL_GetAttribute = X11_GL_GetAttribute;	device->GL_MakeCurrent = X11_GL_MakeCurrent;	device->GL_SwapBuffers = X11_GL_SwapBuffers;#endif	device->SetCaption = X11_SetCaption;	device->SetIcon = X11_SetIcon;	device->IconifyWindow = X11_IconifyWindow;	device->GrabInput = X11_GrabInput;	device->GetWMInfo = X11_GetWMInfo;	device->FreeWMCursor = X11_FreeWMCursor;	device->CreateWMCursor = X11_CreateWMCursor;	device->ShowWMCursor = X11_ShowWMCursor;	device->WarpWMCursor = X11_WarpWMCursor;	device->CheckMouseMode = X11_CheckMouseMode;	device->InitOSKeymap = X11_InitOSKeymap;	device->PumpEvents = X11_PumpEvents;	device->free = X11_DeleteDevice;	return device;}VideoBootStrap X11_bootstrap = {	"x11", "X Window System",	X11_Available, X11_CreateDevice};/* Shared memory information */extern int XShmQueryExtension(Display *dpy);	/* Not in X11 headers *//* Normal X11 error handler routine */static int (*X_handler)(Display *, XErrorEvent *) = NULL;static int x_errhandler(Display *d, XErrorEvent *e){#ifdef XFREE86_VM	extern int vm_error;#endif#ifdef XFREE86_DGAMOUSE	extern int dga_error;#endif#ifdef XFREE86_VM	/* VidMode errors are non-fatal. :) */	/* Are the errors offset by one from the error base?	   e.g. the error base is 143, the code is 148, and the	        actual error is XF86VidModeExtensionDisabled (4) ?	 */        if ( (vm_error >= 0) &&	     (((e->error_code == BadRequest)&&(e->request_code == vm_error)) ||	      ((e->error_code > vm_error) &&	       (e->error_code <= (vm_error+XF86VidModeNumberErrors)))) ) {#ifdef XFREE86_DEBUG{ char errmsg[1024];  XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));printf("VidMode error: %s\n", errmsg);}#endif        	return(0);        }#endif /* XFREE86_VM */#ifdef XFREE86_DGAMOUSE	/* DGA errors can be non-fatal. :) */        if ( (dga_error >= 0) &&	     ((e->error_code > dga_error) &&	      (e->error_code <= (dga_error+XF86DGANumberErrors))) ) {#ifdef XFREE86_DEBUG{ char errmsg[1024];  XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));printf("DGA error: %s\n", errmsg);}#endif        	return(0);        }#endif /* XFREE86_DGAMOUSE */	return(X_handler(d,e));}/* X11 I/O error handler routine */static int (*XIO_handler)(Display *) = NULL;static int xio_errhandler(Display *d){	/* Ack!  Lost X11 connection! */	/* We will crash if we try to clean up our display */	if ( current_video->hidden->Ximage ) {		SDL_VideoSurface->pixels = NULL;	}	current_video->hidden->X11_Display = NULL;	/* Continue with the standard X11 error handler */	return(XIO_handler(d));}/* Create auxiliary (toplevel) windows with the current visual */static void create_aux_windows(_THIS){    XSetWindowAttributes xattr;    XWMHints *hints;    XTextProperty titleprop, iconprop;    int def_vis = (SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen));    /* Don't create any extra windows if we are being managed */    if ( SDL_windowid ) {	FSwindow = 0;	WMwindow = strtol(SDL_windowid, NULL, 0);        return;    }    if(FSwindow)	XDestroyWindow(SDL_Display, FSwindow);    xattr.override_redirect = True;    xattr.background_pixel = def_vis ? BlackPixel(SDL_Display, SDL_Screen) : 0;    xattr.border_pixel = 0;    xattr.colormap = SDL_XColorMap;    FSwindow = XCreateWindow(SDL_Display, SDL_Root,                             xinerama_x, xinerama_y, 32, 32, 0,			     this->hidden->depth, InputOutput, SDL_Visual,			     CWOverrideRedirect | CWBackPixel | CWBorderPixel			     | CWColormap,			     &xattr);    XSelectInput(SDL_Display, FSwindow, StructureNotifyMask);    /* Tell KDE to keep the fullscreen window on top */    {	XEvent ev;	long mask;	memset(&ev, 0, sizeof(ev));	ev.xclient.type = ClientMessage;	ev.xclient.window = SDL_Root;	ev.xclient.message_type = XInternAtom(SDL_Display,					      "KWM_KEEP_ON_TOP", False);	ev.xclient.format = 32;	ev.xclient.data.l[0] = FSwindow;	ev.xclient.data.l[1] = CurrentTime;	mask = SubstructureRedirectMask;	XSendEvent(SDL_Display, SDL_Root, False, mask, &ev);    }    hints = NULL;    titleprop.value = iconprop.value = NULL;    if(WMwindow) {	/* All window attributes must survive the recreation */	hints = XGetWMHints(SDL_Display, WMwindow);	XGetWMName(SDL_Display, WMwindow, &titleprop);	XGetWMIconName(SDL_Display, WMwindow, &iconprop);	XDestroyWindow(SDL_Display, WMwindow);    }    /* Create the window for windowed management */    /* (reusing the xattr structure above) */    WMwindow = XCreateWindow(SDL_Display, SDL_Root, 0, 0, 32, 32, 0,			     this->hidden->depth, InputOutput, SDL_Visual,			     CWBackPixel | CWBorderPixel | CWColormap,			     &xattr);    /* Set the input hints so we get keyboard input */    if(!hints) {	hints = XAllocWMHints();	hints->input = True;	hints->flags = InputHint;    }    XSetWMHints(SDL_Display, WMwindow, hints);    XFree(hints);    if(titleprop.value) {	XSetWMName(SDL_Display, WMwindow, &titleprop);	XFree(titleprop.value);    }    if(iconprop.value) {	XSetWMIconName(SDL_Display, WMwindow, &iconprop);	XFree(iconprop.value);    }    XSelectInput(SDL_Display, WMwindow,		 FocusChangeMask | KeyPressMask | KeyReleaseMask		 | PropertyChangeMask | StructureNotifyMask | KeymapStateMask);    /* Set the class hints so we can get an icon (AfterStep) */    {	XClassHint *classhints;	classhints = XAllocClassHint();	if(classhints != NULL) {            char *classname = getenv("SDL_VIDEO_X11_WMCLASS");            if ( ! classname ) {                classname = "SDL_App";            }	    classhints->res_name = classname;	    classhints->res_class = classname;	    XSetClassHint(SDL_Display, WMwindow, classhints);	    XFree(classhints);	}    }    /* Allow the window to be deleted by the window manager */    WM_DELETE_WINDOW = XInternAtom(SDL_Display, "WM_DELETE_WINDOW", False);    XSetWMProtocols(SDL_Display, WMwindow, &WM_DELETE_WINDOW, 1);}static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat){	char *display;	int i;	/* Open the X11 display */	display = NULL;		/* Get it from DISPLAY environment variable */	if ( (strncmp(XDisplayName(display), ":", 1) == 0) ||	     (strncmp(XDisplayName(display), "unix:", 5) == 0) ) {		local_X11 = 1;	} else {		local_X11 = 0;	}	SDL_Display = XOpenDisplay(display);	if ( SDL_Display == NULL ) {		SDL_SetError("Couldn't open X11 display");		return(-1);	}#ifdef X11_DEBUG	XSynchronize(SDL_Display, True);#endif	/* Create an alternate X display for graphics updates -- allows us	   to do graphics updates in a separate thread from event handling.	   Thread-safe X11 doesn't seem to exist.	 */	GFX_Display = XOpenDisplay(display);	if ( GFX_Display == NULL ) {		SDL_SetError("Couldn't open X11 display");		return(-1);	}	/* Set the normal X error handler */	X_handler = XSetErrorHandler(x_errhandler);	/* Set the error handler if we lose the X display */	XIO_handler = XSetIOErrorHandler(xio_errhandler);	/* use default screen (from $DISPLAY) */	SDL_Screen = DefaultScreen(SDL_Display);	use_mitshm = 0;#ifndef NO_SHARED_MEMORY	/* Check for MIT shared memory extension */	if ( local_X11 ) {		use_mitshm = XShmQueryExtension(SDL_Display);	}#endif /* NO_SHARED_MEMORY */	/* Get the available video modes */	if(X11_GetVideoModes(this) < 0)	    return -1;	/* Determine the default screen depth:	   Use the default visual (or at least one with the same depth) */	SDL_DisplayColormap = DefaultColormap(SDL_Display, SDL_Screen);	for(i = 0; i < this->hidden->nvisuals; i++)	    if(this->hidden->visuals[i].depth == DefaultDepth(SDL_Display,							      SDL_Screen))		break;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产aⅴ精品一区二区三区色成熟| 粉嫩13p一区二区三区| 亚洲图片激情小说| 日本一区免费视频| 久久精品夜夜夜夜久久| 精品国产1区2区3区| 日韩欧美激情一区| 日韩欧美久久久| 欧美zozo另类异族| 久久你懂得1024| 国产性天天综合网| 国产女人18毛片水真多成人如厕| 国产欧美综合色| 亚洲欧洲另类国产综合| 成人免费一区二区三区在线观看| 中文字幕一区二区三区精华液| 国产精品久久久久影院亚瑟| 最新中文字幕一区二区三区 | 亚洲视频在线观看一区| 国产精品网站导航| 中文字幕中文乱码欧美一区二区 | 精品午夜久久福利影院| 九九**精品视频免费播放| 国产一区二区影院| 9l国产精品久久久久麻豆| 色综合久久综合网欧美综合网| 91丝袜高跟美女视频| 欧美日韩亚州综合| 日韩欧美国产成人一区二区| 久久精品一区二区三区av| 国产精品美女久久久久久久| 一区二区三区视频在线看| 丝袜美腿一区二区三区| 国产一区二区不卡老阿姨| 成人av动漫在线| 欧美日韩一区久久| 国产亚洲欧美在线| 一区二区三区不卡视频| 日本午夜一本久久久综合| 99久久精品国产一区二区三区 | 91精品国产综合久久精品app| 日韩欧美亚洲国产另类| 国产精品久久久久久久久免费相片 | 欧美日韩一级二级三级| 欧美大肚乱孕交hd孕妇| 国产精品久久久久久久久晋中| 亚洲在线免费播放| 国产精品影视在线观看| 欧美综合亚洲图片综合区| 欧美成人女星排名| 亚洲日本va午夜在线电影| 日本不卡一区二区| 99这里都是精品| 欧美一区二区三区视频在线| 国产精品久久久一本精品| 日本不卡视频一二三区| 色综合久久久久综合| 精品少妇一区二区三区日产乱码| 亚洲激情五月婷婷| 国产综合色视频| 欧美精品1区2区3区| **欧美大码日韩| 极品美女销魂一区二区三区 | 精品福利一区二区三区免费视频| 亚洲男人的天堂av| 国产一区二区在线电影| 91麻豆精品国产91| 亚洲欧美另类小说| 国产一区二区女| 欧美精品亚洲二区| 亚洲视频每日更新| 福利电影一区二区三区| 日韩一区二区在线观看视频 | 日韩有码一区二区三区| 成人av在线看| wwwwww.欧美系列| 偷窥国产亚洲免费视频| 色哟哟一区二区三区| 国产女主播一区| 麻豆国产欧美一区二区三区| 欧美日韩二区三区| 一区二区三区欧美日韩| jiyouzz国产精品久久| 久久精品一级爱片| 精品一区二区在线视频| 91麻豆精品国产91久久久久久 | 日韩精品一区二区三区四区视频 | 91影视在线播放| 欧美国产精品久久| 国产成人av一区二区三区在线观看| 欧美一区二区三区啪啪| 性感美女久久精品| 欧美午夜电影网| 亚洲高清在线视频| 欧美无砖砖区免费| 亚洲成av人**亚洲成av**| 91丝袜美腿高跟国产极品老师| 欧美激情中文不卡| 成人免费av资源| 欧美激情一区二区三区蜜桃视频| 国产精品一区不卡| 久久久久久**毛片大全| 国产乱码字幕精品高清av| 精品盗摄一区二区三区| 久草在线在线精品观看| 日韩精品在线一区| 精品亚洲国产成人av制服丝袜 | 天天综合色天天综合| 91麻豆精品国产综合久久久久久| 五月天国产精品| 欧美精品在线观看播放| 日欧美一区二区| 91精品国产综合久久久久久| 奇米色777欧美一区二区| 日韩丝袜美女视频| 国产福利精品一区| 国产精品国产三级国产aⅴ原创 | 91精品国产一区二区三区蜜臀| 日韩av一区二区三区四区| 欧美一区二区三级| 国产毛片一区二区| 中文字幕中文字幕在线一区| 色国产综合视频| 青青草97国产精品免费观看无弹窗版| 日韩亚洲欧美中文三级| 久久av老司机精品网站导航| 国产人成一区二区三区影院| av资源网一区| 亚洲一区二区三区视频在线 | 午夜精品久久一牛影视| 日韩欧美中文字幕一区| 国产精品一二三| 亚洲日本一区二区三区| 3atv一区二区三区| 激情小说亚洲一区| 国产精品入口麻豆九色| 色综合天天综合在线视频| 午夜精品久久久久久久99水蜜桃 | 久久久天堂av| 91在线高清观看| 日本伊人色综合网| 欧美国产精品久久| 欧美日韩国产在线观看| 精品一区二区三区视频在线观看| 中文字幕av资源一区| 欧美日韩精品一区二区| 国产精品综合久久| 亚洲成人av电影在线| 久久中文字幕电影| 色视频一区二区| 激情综合亚洲精品| 伊人开心综合网| 精品国产一二三区| 在线看不卡av| 国产美女视频91| 亚洲va在线va天堂| 亚洲国产成人在线| 911精品国产一区二区在线| 国产成人无遮挡在线视频| 亚洲一区二区三区精品在线| 久久久777精品电影网影网| 欧美在线综合视频| 国产成人激情av| 美国十次了思思久久精品导航| 中文字幕日韩精品一区| 日韩女优av电影| 91福利小视频| 国产成人精品亚洲午夜麻豆| 天天色 色综合| 亚洲欧美一区二区久久| 久久伊人中文字幕| 欧美日韩国产电影| 99这里只有久久精品视频| 极品少妇一区二区三区精品视频| 亚洲成人动漫在线观看| 最好看的中文字幕久久| 久久精品一二三| 日韩精品影音先锋| 5月丁香婷婷综合| 色偷偷久久一区二区三区| 国产成人亚洲综合色影视| 免费在线成人网| 午夜电影一区二区三区| 亚洲精品国产成人久久av盗摄 | 韩国午夜理伦三级不卡影院| 午夜精品久久久久| 一区二区免费看| 亚洲视频每日更新| 国产精品福利影院| 国产精品三级久久久久三级| 久久久久久久久伊人| 日韩一区二区三免费高清| 欧美日韩高清一区二区不卡| 欧美性生活久久| 91精品办公室少妇高潮对白| 99麻豆久久久国产精品免费| 成人国产精品免费观看视频| 国产成人精品午夜视频免费| 国内不卡的二区三区中文字幕| 麻豆91精品91久久久的内涵|