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

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

?? video.c

?? libminigui-1.3.0.tar.gz。 miniGUI的庫函數(shù)源代碼!
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/***  $Id: video.c,v 1.14 2003/11/22 04:44:14 weiym Exp $**  **  Port to MiniGUI by Wei Yongming (2001/10/03).**  Copyright (C) 2001 ~ 2002 Wei Yongming.**  Copyright (C) 2003 Feynman Software.****  SDL - Simple DirectMedia Layer**  Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program 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 General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*//* The high-level video driver subsystem */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "common.h"#include "minigui.h"#include "newgal.h"#include "sysvideo.h"#include "blit.h"#include "pixels_c.h"/* Available video drivers */static VideoBootStrap *bootstrap[] = {#ifdef ENABLE_DUMMY    &DUMMY_bootstrap,#endif#ifdef ENABLE_FBCON    &FBCON_bootstrap,#endif#ifdef ENABLE_QVFB    &QVFB_bootstrap,#endif#ifdef ENABLE_ECOSLCD    &ECOSLCD_bootstrap,#endif#ifdef ENABLE_X11    &X11_bootstrap,#endif#ifdef ENABLE_DGA    &DGA_bootstrap,#endif#ifdef ENABLE_GGI    &GGI_bootstrap,#endif#ifdef ENABLE_SVGALIB    &SVGALIB_bootstrap,#endif    NULL};GAL_VideoDevice *current_video = NULL;/* Various local functions */int GAL_VideoInit(const char *driver_name, Uint32 flags);void GAL_VideoQuit(void);/* * Initialize the video subsystems -- determine native pixel format */int GAL_VideoInit (const char *driver_name, Uint32 flags){    GAL_VideoDevice *video;    int index;    int i;    GAL_PixelFormat vformat;    Uint32 video_flags;    /* Check to make sure we don't overwrite 'current_video' */    if ( current_video != NULL ) {        GAL_VideoQuit();    }    /* Select the proper video driver */    index = 0;    video = NULL;    if ( driver_name != NULL ) {        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 ) {        GAL_SetError("No available video device.\n");        return(-1);    }    current_video = video;    current_video->name = bootstrap[i]->name;    /* Do some basic variable initialization */    video->screen = NULL;#if 0    video->shadow = NULL;    video->visible = NULL;#endif    video->physpal = NULL;    video->offset_x = 0;    video->offset_y = 0;    memset(&video->info, 0, (sizeof video->info));    /* Initialize the video subsystem */    memset(&vformat, 0, sizeof(vformat));    if ( video->VideoInit(video, &vformat) < 0 ) {        GAL_VideoQuit();        return(-1);    }    /* Create a zero sized video surface of the appropriate format */    video_flags = GAL_SWSURFACE;    GAL_VideoSurface = GAL_CreateRGBSurface(video_flags, 0, 0,                vformat.BitsPerPixel,                vformat.Rmask, vformat.Gmask, vformat.Bmask, 0);    if ( GAL_VideoSurface == NULL ) {        GAL_VideoQuit();        return(-1);    }    video->info.vfmt = GAL_VideoSurface->format;    /* We're ready to go! */    return(0);}char *GAL_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 */GAL_Surface *GAL_GetVideoSurface(void){    GAL_Surface *visible;    visible = NULL;    if ( current_video ) {#if 0        visible = current_video->visible;#else        visible = current_video->screen;#endif    }    return(visible);}/* * Get the current information about the video hardware */const GAL_VideoInfo *GAL_GetVideoInfo(void){    const GAL_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 (GAL_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 GAL_GetVideoInfo()->vfmt */GAL_Rect ** GAL_ListModes (GAL_PixelFormat *format, Uint32 flags){    GAL_VideoDevice *video = current_video;    GAL_VideoDevice *this  = current_video;    GAL_Rect **modes;    modes = NULL;    if ( GAL_VideoSurface ) {        if ( format == NULL ) {            format = GAL_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, GAL_SetVideoMode() will succeed, * but will emulate the requested bits-per-pixel with a shadow surface. */static Uint8 GAL_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 GAL_VideoModeOK (int width, int height, int bpp, Uint32 flags) {    int table, b, i;    int supported;    GAL_PixelFormat format;    GAL_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;    GAL_closest_depths[table][0] = bpp;    GAL_closest_depths[table][7] = 0;    for ( b = 0; !supported && GAL_closest_depths[table][b]; ++b ) {        format.BitsPerPixel = GAL_closest_depths[table][b];        sizes = GAL_ListModes(&format, flags);        if ( sizes == (GAL_Rect **)0 ) {            /* No sizes supported at this bit-depth */            continue;        } else         if ( (sizes == (GAL_Rect **)-1) ||             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(GAL_closest_depths[table][b]);    } else {        return(0);    }}/* * Get the closest non-emulated video mode to the one requested */static int GAL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags){    int table, b, i;    int supported;    int native_bpp;    GAL_PixelFormat format;    GAL_Rect **sizes;    /* Try the original video mode, get the closest depth */    native_bpp = GAL_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;    GAL_closest_depths[table][0] = *BitsPerPixel;    GAL_closest_depths[table][7] = GAL_VideoSurface->format->BitsPerPixel;    for ( b = 0; !supported && GAL_closest_depths[table][b]; ++b ) {        format.BitsPerPixel = GAL_closest_depths[table][b];        sizes = GAL_ListModes(&format, flags);        if ( sizes == (GAL_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 = GAL_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 */            --i;            *w = sizes[i]->w;            *h = sizes[i]->h;            *BitsPerPixel = GAL_closest_depths[table][b];            supported = 1;        }    }    if ( ! supported ) {        GAL_SetError("No video mode large enough for the resolution specified.\n");    }    return(supported);}/* This should probably go somewhere else -- like GAL_surface.c */static void GAL_ClearSurface(GAL_Surface *surface){    Uint32 black;    black = GAL_MapRGB(surface->format, 0, 0, 0);    GAL_FillRect(surface, NULL, black);#if 0    if ((surface->flags&GAL_HWSURFACE) && (surface->flags&GAL_DOUBLEBUF)) {        GAL_Flip(surface);        GAL_FillRect(surface, NULL, black);    }    GAL_Flip(surface);#endif}#if 0/* * Create a shadow surface suitable for fooling the app. :-) */static void GAL_CreateShadowSurface(int depth){    Uint32 Rmask, Gmask, Bmask;    /* Allocate the shadow surface */    if ( depth == (GAL_VideoSurface->format)->BitsPerPixel ) {        Rmask = (GAL_VideoSurface->format)->Rmask;        Gmask = (GAL_VideoSurface->format)->Gmask;        Bmask = (GAL_VideoSurface->format)->Bmask;    } else {        Rmask = Gmask = Bmask = 0;    }    GAL_ShadowSurface = GAL_CreateRGBSurface(GAL_SWSURFACE,                GAL_VideoSurface->w, GAL_VideoSurface->h,                        depth, Rmask, Gmask, Bmask, 0);    if ( GAL_ShadowSurface == NULL ) {        return;    }    /* 8-bit shadow surfaces report that they have exclusive palette */    if ( GAL_ShadowSurface->format->palette ) {        GAL_ShadowSurface->flags |= GAL_HWPALETTE;        if ( depth == (GAL_VideoSurface->format)->BitsPerPixel ) {            memcpy(GAL_ShadowSurface->format->palette->colors,                GAL_VideoSurface->format->palette->colors,                GAL_VideoSurface->format->palette->ncolors*                            sizeof(GAL_Color));        } else {            GAL_DitherColors(            GAL_ShadowSurface->format->palette->colors, depth);        }    }    /* If the video surface is fullscreen, the shadow should say so */    if ( (GAL_VideoSurface->flags & GAL_FULLSCREEN) == GAL_FULLSCREEN ) {        GAL_ShadowSurface->flags |= GAL_FULLSCREEN;    }    /* If the video surface is flippable, the shadow should say so */    if ( (GAL_VideoSurface->flags & GAL_DOUBLEBUF) == GAL_DOUBLEBUF ) {        GAL_ShadowSurface->flags |= GAL_DOUBLEBUF;    }    return;}#endif/* * Set the requested video mode, allocating a shadow buffer if necessary. */GAL_Surface * GAL_SetVideoMode (int width, int height, int bpp, Uint32 flags){    GAL_VideoDevice *video, *this;    GAL_Surface *prev_mode, *mode;    int video_w;    int video_h;    int video_bpp;    this = video = current_video;    /* Default to the current video bpp */    if ( bpp == 0 ) {        flags |= GAL_ANYFORMAT;        bpp = GAL_VideoSurface->format->BitsPerPixel;    }    /* Get a good video mode, the closest one possible */    video_w = width;    video_h = height;    video_bpp = bpp;#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    if ( mgIsServer && !GAL_GetVideoMode(&video_w, &video_h, &video_bpp, flags) ) {#else    if ( !GAL_GetVideoMode(&video_w, &video_h, &video_bpp, flags) ) {#endif        return(NULL);    }    /* Check the requested flags */    /* There's no palette in > 8 bits-per-pixel mode */    if ( video_bpp > 8 ) {        flags &= ~GAL_HWPALETTE;    }#if 0    if ( (flags&GAL_DOUBLEBUF) == GAL_DOUBLEBUF ) {        /* Use hardware surfaces when double-buffering */        flags |= GAL_HWSURFACE;    }    /* Clean up any previous video mode */    if ( GAL_PublicSurface != NULL ) {        GAL_PublicSurface = NULL;    }    if ( GAL_ShadowSurface != NULL ) {        GAL_Surface *ready_to_go;        ready_to_go = GAL_ShadowSurface;        GAL_ShadowSurface = NULL;        GAL_FreeSurface(ready_to_go);    }#endif    if ( video->physpal ) {        free(video->physpal->colors);        free(video->physpal);        video->physpal = NULL;    }    /* Try to set the video mode, along with offset and clipping */    prev_mode = GAL_VideoSurface;    GAL_VideoSurface = NULL;    /* In case it's freed by driver */    mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags);    /*     * rcg11292000     * If you try to set an GAL_OPENGL surface, and fail to find a     * matching  visual, then the next call to GAL_SetVideoMode()     * will segfault, since  we no longer point to a dummy surface,     * but rather NULL.     * Sam 11/29/00     * WARNING, we need to make sure that the previous mode hasn't     * already been freed by the video driver.  What do we do in     * that case?  Should we call GAL_VideoInit() again?     */    GAL_VideoSurface = (mode != NULL) ? mode : prev_mode;    if ((mode != NULL)) {        /* Sanity check */        if ( (mode->w < width) || (mode->h < height) ) {            GAL_SetError("Video mode smaller than requested");            return(NULL);        }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久精品麻豆| 欧美激情自拍偷拍| 自拍偷自拍亚洲精品播放| 加勒比av一区二区| 日韩欧美精品在线视频| 日日摸夜夜添夜夜添国产精品| 欧美在线视频日韩| 久久精品国产亚洲一区二区三区 | 天堂va蜜桃一区二区三区| 久久久一区二区三区捆绑**| 久久er99精品| 一区二区三区在线视频观看| 欧美自拍丝袜亚洲| 懂色av噜噜一区二区三区av| 国产精品久久久久久久裸模| 91丨porny丨最新| 亚洲永久精品大片| 91精品国产综合久久精品性色| 97精品久久久午夜一区二区三区 | 99re成人精品视频| 狠狠色丁香婷综合久久| 国产欧美日韩卡一| 91丨porny丨首页| 国产一区二区毛片| 中文字幕中文字幕一区| 精品国产一区a| 不卡视频在线看| 一区二区三区在线视频观看58| 国产片一区二区| 久久久久国产精品麻豆ai换脸| 3d动漫精品啪啪一区二区竹菊| 在线观看日韩电影| 日韩一区二区电影网| 国产精品123| 亚洲一区二区五区| 亚洲日本青草视频在线怡红院| 国产精品视频一二| 欧美日高清视频| 国产精品一区二区三区乱码| 亚洲老司机在线| www日韩大片| 在线观看免费视频综合| 91在线观看美女| 一本大道久久a久久精二百| 午夜激情一区二区| 中文字幕欧美激情| 欧美激情在线看| 久久免费看少妇高潮| 久久日韩精品一区二区五区| 制服丝袜一区二区三区| 日本高清不卡aⅴ免费网站| 麻豆精品视频在线| 亚洲激情自拍视频| 亚洲欧洲国产日韩| 久久精品人人做人人爽97| 欧美色偷偷大香| av资源网一区| 国产毛片精品视频| 国产精品996| 99久久精品国产一区| 91在线码无精品| 欧美日韩精品系列| 91精品国产全国免费观看| 精品欧美一区二区久久| 欧美精品久久久久久久多人混战| jiyouzz国产精品久久| 色偷偷一区二区三区| 欧美日韩一本到| 欧美一级黄色大片| 久久久久国产精品麻豆ai换脸| 国产精品天干天干在线综合| 国产精品成人免费| 午夜视频一区二区| 国产一区二区三区久久悠悠色av| 暴力调教一区二区三区| 欧美性受极品xxxx喷水| 一道本成人在线| 91精品国产一区二区三区| 国产亚洲精品aa| 亚洲精品日日夜夜| 老色鬼精品视频在线观看播放| 成人三级在线视频| eeuss鲁片一区二区三区 | 婷婷久久综合九色综合绿巨人| 欧美a级一区二区| 美女性感视频久久| 粉嫩av亚洲一区二区图片| 欧洲一区二区三区免费视频| 26uuu精品一区二区在线观看| 亚洲欧美在线aaa| 久久国产剧场电影| 久久一夜天堂av一区二区三区| 国产精品每日更新在线播放网址| 亚洲国产日韩a在线播放性色| 亚洲综合免费观看高清在线观看| 久久国产日韩欧美精品| 色一情一乱一乱一91av| 精品欧美黑人一区二区三区| 亚洲欧美成aⅴ人在线观看 | 美女视频黄免费的久久| gogo大胆日本视频一区| 日韩欧美一二三| 亚洲一区二区精品久久av| 成人精品鲁一区一区二区| 欧美一级二级在线观看| 亚洲综合成人网| 成人毛片在线观看| 欧美电影精品一区二区| 亚洲一二三级电影| 成人av动漫在线| 久久众筹精品私拍模特| 日韩经典一区二区| 在线亚洲一区观看| 中文字幕亚洲欧美在线不卡| 黄色精品一二区| 欧美一级免费大片| 亚洲午夜三级在线| 色婷婷国产精品综合在线观看| 久久久久久久久岛国免费| 喷水一区二区三区| 欧美日韩一区二区三区在线 | 国产女人18水真多18精品一级做 | 精品第一国产综合精品aⅴ| 亚洲网友自拍偷拍| 色狠狠一区二区三区香蕉| 日本一区二区视频在线| 国产一区免费电影| 欧美成人女星排行榜| 日韩不卡在线观看日韩不卡视频| 国产一区二区在线观看视频| 欧美一区二区三级| 视频在线在亚洲| 欧美在线影院一区二区| 亚洲精品成人天堂一二三| 91小视频在线| 亚洲三级电影全部在线观看高清| 波多野结衣的一区二区三区| 国产欧美精品在线观看| 国产高清成人在线| 国产欧美日韩另类视频免费观看| 国产福利91精品| 国产日产欧美精品一区二区三区| 欧美日韩大陆在线| 亚洲一区精品在线| 欧美日韩一级黄| 日韩精品一卡二卡三卡四卡无卡| 精品视频在线视频| 日韩和的一区二区| 欧美日韩亚洲综合一区| 午夜成人免费视频| 日韩一区二区电影网| 狠狠网亚洲精品| 国产精品久久久一本精品| 99视频有精品| 一区二区三区视频在线看| 欧美日韩午夜精品| 看电影不卡的网站| 国产日韩影视精品| 色偷偷久久一区二区三区| 亚洲一区二区三区爽爽爽爽爽 | 欧美久久婷婷综合色| 蜜臀av性久久久久蜜臀av麻豆| 久久夜色精品国产噜噜av| 成人午夜视频网站| 亚洲高清免费观看| 欧美大片日本大片免费观看| 国产成人免费在线| 亚洲综合久久久| 26uuu欧美| 色综合久久久久久久| 日韩精品欧美精品| 日本一区二区成人| 欧美吞精做爰啪啪高潮| 久久66热re国产| 亚洲特黄一级片| 欧美一级国产精品| 99久久久国产精品| 日日骚欧美日韩| 中文成人综合网| 欧美疯狂性受xxxxx喷水图片| 国产一区福利在线| 国产乱人伦偷精品视频免下载| 亚洲欧美综合另类在线卡通| 欧美色图免费看| 国产suv精品一区二区883| 亚洲成人7777| 欧美精品一卡二卡| 成人黄色777网| 日韩影院在线观看| 国产精品久久久久久久久久久免费看| 欧美色精品在线视频| 国产在线视频一区二区三区| 亚洲精品乱码久久久久| 精品人在线二区三区| 99精品偷自拍| 国产麻豆91精品| 天天操天天色综合| 亚洲免费观看高清| 久久九九影视网| 日韩视频中午一区|