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

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

?? sdl_x11video.c

?? Simple DirectMedia Layer - Simple DirectMedia Layer 是一個跨平臺的多媒體庫設計用來提供快速圖形framebuffer和音頻驅動。應用MPEG為軟件
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*    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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产v综合v亚洲欧| 日韩欧美在线综合网| 亚洲最大成人网4388xx| 91久久精品日日躁夜夜躁欧美| 亚洲欧美日韩精品久久久久| 91美女片黄在线观看| 夜夜精品浪潮av一区二区三区| 欧美日韩专区在线| 免费观看一级特黄欧美大片| 精品久久久久久久久久久久包黑料 | 中文一区二区完整视频在线观看| 成人av电影免费观看| 亚洲色图.com| 欧美久久久久中文字幕| 裸体一区二区三区| 国产欧美精品国产国产专区| 91麻豆国产精品久久| 午夜欧美在线一二页| 欧美成人猛片aaaaaaa| 成人国产精品视频| 亚洲一区二区三区中文字幕 | 久88久久88久久久| 国产精品色噜噜| 日本久久精品电影| 青青国产91久久久久久| 久久精品亚洲精品国产欧美kt∨| 91免费看`日韩一区二区| 性久久久久久久久| 久久奇米777| 色综合夜色一区| 日本不卡免费在线视频| 欧美国产乱子伦| 欧美综合天天夜夜久久| 美女被吸乳得到大胸91| 中文字幕视频一区二区三区久| 欧美日韩一区二区三区不卡 | 久久av资源网| 国产精品国产自产拍高清av| 欧美丰满嫩嫩电影| 国产成人午夜精品影院观看视频 | 综合电影一区二区三区 | 亚洲素人一区二区| 日韩一区二区精品葵司在线| 成人av在线看| 奇米亚洲午夜久久精品| 亚洲三级电影网站| 日韩一级大片在线观看| 91一区一区三区| 激情久久五月天| 亚洲精品高清在线| 26uuu欧美日本| 欧洲视频一区二区| 国产成人在线色| 日韩精品电影在线| 亚洲欧洲精品一区二区三区| 日韩一区二区三区视频在线观看| 99久久er热在这里只有精品66| 日本不卡不码高清免费观看| 亚洲人123区| www国产成人| 欧美视频完全免费看| 成人午夜在线视频| 紧缚奴在线一区二区三区| 一区二区三区在线视频观看 | 美女精品一区二区| 一区二区三区蜜桃网| 久久精品水蜜桃av综合天堂| 欧美久久婷婷综合色| 91亚洲午夜精品久久久久久| 国产麻豆91精品| 日韩黄色在线观看| 一区二区三区在线播| 国产免费观看久久| 精品国产91洋老外米糕| 欧美日本乱大交xxxxx| 色综合色综合色综合 | 91蝌蚪porny九色| 国产麻豆日韩欧美久久| 日本网站在线观看一区二区三区 | 日本特黄久久久高潮| 亚洲影院理伦片| 亚洲视频一二三| 欧美精彩视频一区二区三区| 欧美电影免费观看高清完整版| 欧美午夜精品久久久久久超碰 | 国产精品视频九色porn| 26uuu国产一区二区三区| 这里只有精品电影| 欧美性生活一区| 色诱视频网站一区| 不卡一区在线观看| 国产69精品久久99不卡| 韩国一区二区三区| 蜜臀av性久久久久av蜜臀妖精 | 国产精品中文字幕日韩精品| 久久精品国产一区二区三区免费看| 图片区小说区区亚洲影院| 亚洲国产精品欧美一二99| 亚洲男人天堂一区| 亚洲人亚洲人成电影网站色| 国产精品美女久久久久久久久| 久久精品水蜜桃av综合天堂| 久久久久久久久久久久久久久99 | www激情久久| 精品国产乱码久久久久久牛牛| 日韩一区二区视频在线观看| 欧美一区二区三区视频免费播放| 在线不卡欧美精品一区二区三区| 欧美偷拍一区二区| 欧美男人的天堂一二区| 欧美卡1卡2卡| 欧美精三区欧美精三区| 欧美日韩你懂得| 欧美人与性动xxxx| 欧美一区二区网站| 日韩一区二区三区电影| 欧美va在线播放| 亚洲精品在线免费观看视频| 久久综合av免费| 中文字幕免费观看一区| 国产精品家庭影院| 亚洲精品你懂的| 午夜久久久影院| 免费精品99久久国产综合精品| 精品一区二区三区在线播放视频| 精品无人码麻豆乱码1区2区 | 丰满亚洲少妇av| av亚洲精华国产精华| 91视频在线观看免费| 一本色道久久综合精品竹菊| 91高清视频在线| 欧美福利视频一区| 精品动漫一区二区三区在线观看| 久久先锋影音av鲁色资源网| 国产亚洲一本大道中文在线| 国产精品女主播在线观看| 亚洲人亚洲人成电影网站色| 亚洲一二三四区| 日本成人超碰在线观看| 精品一区中文字幕| 成人爱爱电影网址| 在线视频一区二区三| 欧美精品在线观看播放| 欧美大白屁股肥臀xxxxxx| 国产午夜精品美女毛片视频| 亚洲三级理论片| 三级欧美韩日大片在线看| 激情综合网最新| 成人午夜免费av| 在线观看91精品国产入口| 日韩一区和二区| 国产精品女同互慰在线看| 亚洲国产综合91精品麻豆| 老司机精品视频导航| 丁香婷婷综合色啪| 欧美亚洲综合一区| 精品免费国产二区三区| 1000部国产精品成人观看| 五月激情六月综合| 国产精品 欧美精品| 欧美在线免费观看亚洲| 精品剧情v国产在线观看在线| 亚洲欧美怡红院| 日本一区中文字幕 | 99亚偷拍自图区亚洲| 欧美日韩国产另类一区| 26uuu亚洲婷婷狠狠天堂| 亚洲精品视频免费观看| 久久超级碰视频| 91女厕偷拍女厕偷拍高清| 日韩精品一区二区三区中文精品| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产不卡视频一区| 欧美在线免费播放| 国产亚洲欧美中文| 亚洲一卡二卡三卡四卡无卡久久| 国产在线视视频有精品| 欧美午夜精品久久久久久孕妇 | 激情综合亚洲精品| 在线观看欧美精品| 国产午夜精品久久| 日韩avvvv在线播放| av在线不卡网| 日韩你懂的电影在线观看| 1024成人网| 国产一区二区福利| 在线视频一区二区免费| 久久精品视频一区二区| 天天色图综合网| 99热这里都是精品| 日韩久久久精品| 一区二区不卡在线播放 | 欧美一级免费大片| 亚洲人成7777| 国产成人高清视频| 欧美成人在线直播| 亚洲国产色一区| 99精品视频在线观看免费| 久久久美女艺术照精彩视频福利播放| 亚洲高清在线精品|