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

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

?? sdl_x11gl.c

?? Simple DirectMedia Layer - Simple DirectMedia Layer 是一個跨平臺的多媒體庫設計用來提供快速圖形framebuffer和音頻驅動。應用MPEG為軟件
?? C
字號:
/*    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_x11gl.c,v 1.10 2002/08/19 17:58:08 slouken Exp $";#endif#include <stdlib.h>	/* For getenv() prototype */#include <string.h>#include "SDL_events_c.h"#include "SDL_error.h"#include "SDL_x11video.h"#include "SDL_x11dga_c.h"#include "SDL_x11gl_c.h"#define DEFAULT_OPENGL	"libGL.so.1"/* return the preferred visual to use for openGL graphics */XVisualInfo *X11_GL_GetVisual(_THIS){#ifdef HAVE_OPENGL	/* 64 seems nice. */	int attribs[64];	int i;	/* load the gl driver from a default path */	if ( ! this->gl_config.driver_loaded ) {	        /* no driver has been loaded, use default (ourselves) */	        if ( X11_GL_LoadLibrary(this, NULL) < 0 ) {		        return NULL;		}	}	/* See if we already have a window which we must use */	if ( SDL_windowid ) {		XWindowAttributes a;		XVisualInfo vi_in;		int out_count;		XGetWindowAttributes(SDL_Display, SDL_Window, &a);		vi_in.screen = SDL_Screen;		vi_in.visualid = XVisualIDFromVisual(a.visual);		glx_visualinfo = XGetVisualInfo(SDL_Display,	                     VisualScreenMask|VisualIDMask, &vi_in, &out_count);		return glx_visualinfo;	}        /* Setup our GLX attributes according to the gl_config. */	i = 0;	attribs[i++] = GLX_RGBA;	attribs[i++] = GLX_RED_SIZE;	attribs[i++] = this->gl_config.red_size;	attribs[i++] = GLX_GREEN_SIZE;	attribs[i++] = this->gl_config.green_size;	attribs[i++] = GLX_BLUE_SIZE;	attribs[i++] = this->gl_config.blue_size;	if( this->gl_config.alpha_size ) {		attribs[i++] = GLX_ALPHA_SIZE;		attribs[i++] = this->gl_config.alpha_size;	}	if( this->gl_config.buffer_size ) {		attribs[i++] = GLX_BUFFER_SIZE;		attribs[i++] = this->gl_config.buffer_size;	}	if( this->gl_config.double_buffer ) {		attribs[i++] = GLX_DOUBLEBUFFER;	}	attribs[i++] = GLX_DEPTH_SIZE;	attribs[i++] = this->gl_config.depth_size;	if( this->gl_config.stencil_size ) {		attribs[i++] = GLX_STENCIL_SIZE;		attribs[i++] = this->gl_config.stencil_size;	}	if( this->gl_config.accum_red_size ) {		attribs[i++] = GLX_ACCUM_RED_SIZE;		attribs[i++] = this->gl_config.accum_red_size;	}	if( this->gl_config.accum_green_size ) {		attribs[i++] = GLX_ACCUM_GREEN_SIZE;		attribs[i++] = this->gl_config.accum_green_size;	}	if( this->gl_config.accum_blue_size ) {		attribs[i++] = GLX_ACCUM_BLUE_SIZE;		attribs[i++] = this->gl_config.accum_blue_size;	}	if( this->gl_config.accum_alpha_size ) {		attribs[i++] = GLX_ACCUM_ALPHA_SIZE;		attribs[i++] = this->gl_config.accum_alpha_size;	}	if( this->gl_config.stereo ) {		attribs[i++] = GLX_STEREO;		attribs[i++] = this->gl_config.stereo;	}#ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */	attribs[i++] = GLX_X_VISUAL_TYPE;	attribs[i++] = GLX_DIRECT_COLOR;#endif	attribs[i++] = None; 	glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display, 						  SDL_Screen, attribs);#ifdef GLX_DIRECT_COLOR	if( !glx_visualinfo ) { /* No DirectColor visual?  Try again.. */		attribs[i-3] = None; 		glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display, 						  SDL_Screen, attribs);	}#endif	if( !glx_visualinfo ) {		SDL_SetError( "Couldn't find matching GLX visual");		return NULL;	}	return glx_visualinfo;#else	SDL_SetError("X11 driver not configured with OpenGL");	return NULL;#endif}int X11_GL_CreateWindow(_THIS, int w, int h){	int retval;#ifdef HAVE_OPENGL	XSetWindowAttributes attributes;	unsigned long mask;	unsigned long black;	black = (glx_visualinfo->visual == DefaultVisual(SDL_Display,						 	SDL_Screen))	       	? BlackPixel(SDL_Display, SDL_Screen) : 0;	attributes.background_pixel = black;	attributes.border_pixel = black;	attributes.colormap = SDL_XColorMap;	mask = CWBackPixel | CWBorderPixel | CWColormap;	SDL_Window = XCreateWindow(SDL_Display, WMwindow,			0, 0, w, h, 0, glx_visualinfo->depth,			InputOutput, glx_visualinfo->visual,			mask, &attributes);	if ( !SDL_Window ) {		SDL_SetError("Could not create window");		return -1;	}	retval = 0;#else	SDL_SetError("X11 driver not configured with OpenGL");	retval = -1;#endif	return(retval);}int X11_GL_CreateContext(_THIS){	int retval;#ifdef HAVE_OPENGL	/* We do this to create a clean separation between X and GLX errors. */	XSync( SDL_Display, False );	glx_context = this->gl_data->glXCreateContext(GFX_Display, 				     glx_visualinfo, NULL, True);	XSync( GFX_Display, False );	if (glx_context == NULL) {		SDL_SetError("Could not create GL context");		return -1;	}	gl_active = 1;#else	SDL_SetError("X11 driver not configured with OpenGL");#endif	if ( gl_active ) {		retval = 0;	} else {		retval = -1;	}	return(retval);}void X11_GL_Shutdown(_THIS){#ifdef HAVE_OPENGL	/* Clean up OpenGL */	if( glx_context ) {		this->gl_data->glXMakeCurrent(GFX_Display, None, NULL);		if (glx_context != NULL)			this->gl_data->glXDestroyContext(GFX_Display, glx_context);		if( this->gl_data->glXReleaseBuffersMESA ) {		    this->gl_data->glXReleaseBuffersMESA(GFX_Display,SDL_Window);		}		glx_context = NULL;	}	gl_active = 0;#endif /* HAVE_OPENGL */}#ifdef HAVE_OPENGL/* Make the current context active */int X11_GL_MakeCurrent(_THIS){	int retval;	retval = 0;	if ( ! this->gl_data->glXMakeCurrent(GFX_Display,	                                     SDL_Window, glx_context) ) {		SDL_SetError("Unable to make GL context current");		retval = -1;	}	XSync( GFX_Display, False );	/* More Voodoo X server workarounds... Grr... */	SDL_Lock_EventThread();	X11_CheckDGAMouse(this);	SDL_Unlock_EventThread();	return(retval);}/* Get attribute data from glX. */int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value){	int retval;	int glx_attrib = None;	switch( attrib ) {	    case SDL_GL_RED_SIZE:		glx_attrib = GLX_RED_SIZE;		break;	    case SDL_GL_GREEN_SIZE:		glx_attrib = GLX_GREEN_SIZE;		break;	    case SDL_GL_BLUE_SIZE:		glx_attrib = GLX_BLUE_SIZE;		break;	    case SDL_GL_ALPHA_SIZE:		glx_attrib = GLX_ALPHA_SIZE;		break;	    case SDL_GL_DOUBLEBUFFER:		glx_attrib = GLX_DOUBLEBUFFER;		break;	    case SDL_GL_BUFFER_SIZE:		glx_attrib = GLX_BUFFER_SIZE;		break;	    case SDL_GL_DEPTH_SIZE:		glx_attrib = GLX_DEPTH_SIZE;		break;	    case SDL_GL_STENCIL_SIZE:		glx_attrib = GLX_STENCIL_SIZE;		break;	    case SDL_GL_ACCUM_RED_SIZE:		glx_attrib = GLX_ACCUM_RED_SIZE;		break;	    case SDL_GL_ACCUM_GREEN_SIZE:		glx_attrib = GLX_ACCUM_GREEN_SIZE;		break;	    case SDL_GL_ACCUM_BLUE_SIZE:		glx_attrib = GLX_ACCUM_BLUE_SIZE;		break;	    case SDL_GL_ACCUM_ALPHA_SIZE:		glx_attrib = GLX_ACCUM_ALPHA_SIZE;		break;	    case SDL_GL_STEREO:		glx_attrib = GLX_STEREO;		break;	    default:		return(-1);	}	retval = this->gl_data->glXGetConfig(GFX_Display, glx_visualinfo, glx_attrib, value);	return retval;}void X11_GL_SwapBuffers(_THIS){	this->gl_data->glXSwapBuffers(GFX_Display, SDL_Window);}#endif /* HAVE_OPENGL */void X11_GL_UnloadLibrary(_THIS){#ifdef HAVE_OPENGL	if ( this->gl_config.driver_loaded ) {		dlclose(this->gl_config.dll_handle);		this->gl_data->glXGetProcAddress = NULL;		this->gl_data->glXChooseVisual = NULL;		this->gl_data->glXCreateContext = NULL;		this->gl_data->glXDestroyContext = NULL;		this->gl_data->glXMakeCurrent = NULL;		this->gl_data->glXSwapBuffers = NULL;		this->gl_config.dll_handle = NULL;		this->gl_config.driver_loaded = 0;	}#endif}#ifdef HAVE_OPENGL/* Passing a NULL path means load pointers from the application */int X11_GL_LoadLibrary(_THIS, const char* path) {	void* handle;	int dlopen_flags; 	if ( gl_active ) { 		SDL_SetError("OpenGL context already created"); 		return -1; 	}#ifdef RTLD_GLOBAL	dlopen_flags = RTLD_LAZY | RTLD_GLOBAL;#else	dlopen_flags = RTLD_LAZY;#endif	handle = dlopen(path, dlopen_flags);	/* Catch the case where the application isn't linked with GL */	if ( (dlsym(handle, "glXChooseVisual") == NULL) && (path == NULL) ) {		dlclose(handle);		path = getenv("SDL_VIDEO_GL_DRIVER");		if ( path == NULL ) {			path = DEFAULT_OPENGL;		}		handle = dlopen(path, dlopen_flags);	}	if ( handle == NULL ) {		SDL_SetError("Could not load OpenGL library");		return -1;	}	/* Unload the old driver and reset the pointers */	X11_GL_UnloadLibrary(this);	/* Load new function pointers */	this->gl_data->glXGetProcAddress =		(void *(*)(const GLubyte *)) dlsym(handle, "glXGetProcAddressARB");	this->gl_data->glXChooseVisual =		(XVisualInfo *(*)(Display *, int, int *)) dlsym(handle, "glXChooseVisual");	this->gl_data->glXCreateContext =		(GLXContext (*)(Display *, XVisualInfo *, GLXContext, int)) dlsym(handle, "glXCreateContext");	this->gl_data->glXDestroyContext =		(void (*)(Display *, GLXContext)) dlsym(handle, "glXDestroyContext");	this->gl_data->glXMakeCurrent =		(int (*)(Display *, GLXDrawable, GLXContext)) dlsym(handle, "glXMakeCurrent");	this->gl_data->glXSwapBuffers =		(void (*)(Display *, GLXDrawable)) dlsym(handle, "glXSwapBuffers");	this->gl_data->glXGetConfig =		(int (*)(Display *, XVisualInfo *, int, int *)) dlsym(handle, "glXGetConfig");	/* We don't compare below for this in case we're not using Mesa. */	this->gl_data->glXReleaseBuffersMESA =		(void (*)(Display *, GLXDrawable)) dlsym( handle, "glXReleaseBuffersMESA" );	if ( (this->gl_data->glXChooseVisual == NULL) || 	     (this->gl_data->glXCreateContext == NULL) ||	     (this->gl_data->glXDestroyContext == NULL) ||	     (this->gl_data->glXMakeCurrent == NULL) ||	     (this->gl_data->glXSwapBuffers == NULL) ||	     (this->gl_data->glXGetConfig == NULL) ) {		SDL_SetError("Could not retrieve OpenGL functions");		return -1;	}	this->gl_config.dll_handle = handle;	this->gl_config.driver_loaded = 1;	if ( path ) {		strncpy(this->gl_config.driver_path, path,			sizeof(this->gl_config.driver_path)-1);	} else {		strcpy(this->gl_config.driver_path, "");	}	return 0;}void *X11_GL_GetProcAddress(_THIS, const char* proc){	static char procname[1024];	void* handle;	void* retval;		handle = this->gl_config.dll_handle;#if 0 /* This doesn't work correctly yet */	if ( this->gl_data->glXGetProcAddress ) {        void *func, *func2;		func = this->gl_data->glXGetProcAddress(proc);        func2 = dlsym(handle, proc);        if ( func != func2 ) {fprintf(stderr, "glXGetProcAddress returned %p and dlsym returned %p for %s\n", func, func2, proc);        }        return this->gl_data->glXGetProcAddress(proc);	}#endif#if defined(__OpenBSD__) && !defined(__ELF__)#undef dlsym(x,y);#endif	retval = dlsym(handle, proc);	if (!retval && strlen(proc) <= 1022) {		procname[0] = '_';		strcpy(procname + 1, proc);		retval = dlsym(handle, procname);	}	return retval;}#endif /* HAVE_OPENGL */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产网站一区二区三区| 亚洲欧洲性图库| 制服.丝袜.亚洲.另类.中文| 99re视频这里只有精品| 成人激情综合网站| 国产成人精品1024| 国产成人精品免费视频网站| 从欧美一区二区三区| 不卡的看片网站| 一本一道综合狠狠老| 一本一本大道香蕉久在线精品| 94-欧美-setu| 欧美一a一片一级一片| 欧美性色黄大片| 欧美丰满高潮xxxx喷水动漫 | 久久精品人人做人人爽人人| 精品久久久久久久久久久久包黑料 | 欧美私人免费视频| 欧美日韩成人在线| 日韩欧美一级二级三级久久久 | 奇米影视7777精品一区二区| 久久成人av少妇免费| 国产很黄免费观看久久| 91一区一区三区| 欧美日韩在线播放三区四区| 91精品视频网| 久久久久国产精品免费免费搜索| 中文字幕亚洲在| 亚洲成a人v欧美综合天堂| 日本成人在线不卡视频| 国产露脸91国语对白| 91视频一区二区三区| 欧美二区三区的天堂| 欧美精品一区二区蜜臀亚洲| 国产精品久久久久久户外露出 | 青青草原综合久久大伊人精品| 国产在线精品免费av| 91网站在线播放| 7777精品伊人久久久大香线蕉 | 欧美日韩成人综合| 国产视频一区在线播放| 亚洲欧美日韩在线| 久久99国产精品免费| 91麻豆精东视频| 日韩免费看的电影| 亚洲欧美日韩成人高清在线一区| 久久精品国产99久久6| 91小宝寻花一区二区三区| 欧美一区二区三区爱爱| 亚洲欧美日韩在线不卡| 国内精品久久久久影院一蜜桃| 99久久精品99国产精品| 日韩欧美一卡二卡| 一区二区三区四区不卡在线 | 337p亚洲精品色噜噜噜| 欧美国产激情一区二区三区蜜月| 一区二区国产盗摄色噜噜| 国产一区三区三区| 欧美另类久久久品| 国产精品免费免费| 麻豆高清免费国产一区| 色激情天天射综合网| 久久免费看少妇高潮| 亚洲国产精品久久人人爱 | 久久综合色8888| 亚洲曰韩产成在线| 成人免费毛片app| 精品欧美一区二区久久| 亚洲午夜电影在线观看| av电影在线观看完整版一区二区| 日韩一级黄色片| 亚洲午夜精品网| 成人高清在线视频| 精品国产一区二区三区不卡 | 久久丁香综合五月国产三级网站| 色先锋资源久久综合| 国产精品丝袜久久久久久app| 青青草国产精品97视觉盛宴| 欧美午夜不卡视频| 亚洲日本中文字幕区| 国产激情精品久久久第一区二区| 日韩视频免费观看高清完整版 | 国产精品国产精品国产专区不蜜| 国产乱码字幕精品高清av | 中文字幕一区视频| 国产精品一区二区你懂的| 欧美成人一区二区三区片免费| 亚洲国产欧美在线人成| 99re热这里只有精品免费视频| 中文字幕第一区第二区| 国产成人精品在线看| 久久久久久夜精品精品免费| 精品制服美女丁香| 欧美电视剧在线观看完整版| 青青草国产精品97视觉盛宴| 欧美一区二区在线免费播放| 日日欢夜夜爽一区| 欧美精品一二三四| 日日夜夜精品视频免费| 91精品麻豆日日躁夜夜躁| 欧美色图激情小说| 国产成人免费xxxxxxxx| 日韩精品一区二区在线| 日韩电影在线免费观看| 欧美一区二区三区在| 久久久久久黄色| 国产乱码精品一区二区三区av| 久久青草国产手机看片福利盒子 | 成人午夜视频在线| 国产精品欧美久久久久一区二区| 国产a精品视频| 国产精品亲子伦对白| 不卡视频一二三四| 亚洲女同一区二区| 欧美色网站导航| 日日欢夜夜爽一区| 26uuu国产在线精品一区二区| 国产一区激情在线| 国产精品区一区二区三区| 99久久精品99国产精品| 亚洲国产乱码最新视频| 日韩欧美在线观看一区二区三区| 久久69国产一区二区蜜臀| 久久久久久久久一| 99在线热播精品免费| 亚洲一区免费观看| 3751色影院一区二区三区| 国产乱码字幕精品高清av| 最近中文字幕一区二区三区| 欧美伊人久久久久久午夜久久久久| 日日噜噜夜夜狠狠视频欧美人| 精品av久久707| av一区二区三区四区| 亚洲在线视频一区| 精品少妇一区二区三区| av成人老司机| 视频一区国产视频| 国产欧美日韩精品一区| 91久久精品网| 奇米综合一区二区三区精品视频| 国产三级欧美三级| 91成人国产精品| 美女诱惑一区二区| 国产精品久久午夜| 欧美日本国产视频| 国产91在线观看丝袜| 成人欧美一区二区三区在线播放| 欧美喷水一区二区| 国产成人亚洲综合a∨婷婷| 亚洲一区二区三区爽爽爽爽爽 | 奇米影视一区二区三区小说| 欧美极品aⅴ影院| 欧美男生操女生| 粉嫩av一区二区三区在线播放 | 粉嫩久久99精品久久久久久夜| 精品剧情在线观看| 欧美色倩网站大全免费| 国产精品性做久久久久久| 图片区小说区国产精品视频| 国产精品午夜电影| 日韩一区二区三| 色999日韩国产欧美一区二区| 久久电影网站中文字幕| 艳妇臀荡乳欲伦亚洲一区| 久久久久久97三级| 91精品视频网| 91免费在线视频观看| 国产在线视频一区二区三区| 亚洲国产一区二区视频| 国产日韩三级在线| 欧美一区二区三区视频在线| 一本大道综合伊人精品热热| 国产福利精品一区二区| 日本欧美在线看| 亚洲综合一区二区三区| 国产三级一区二区| 精品国产精品网麻豆系列| 欧美日韩成人综合在线一区二区| av电影在线观看一区| 国产高清成人在线| 国产一区二区调教| 麻豆精品在线播放| 日韩精品国产精品| 亚洲国产成人91porn| 亚洲天天做日日做天天谢日日欢| 久久久精品2019中文字幕之3| 日韩欧美专区在线| 欧美肥妇bbw| 在线91免费看| 欧美日韩另类一区| 色94色欧美sute亚洲线路一久| 成人av高清在线| 懂色一区二区三区免费观看 | 欧美精品一区二区蜜臀亚洲| 日韩一级完整毛片| 日韩视频在线一区二区| 日韩一区二区免费在线电影| 欧美日韩一区高清| 欧美日韩免费高清一区色橹橹| 在线观看日韩av先锋影音电影院|