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

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

?? grdevice.c

?? Demo for Free type 2.2.1
?? C
字號:
#include "grobjs.h"
#include "grdevice.h"
#include <stdlib.h>
#include <string.h>

  grDeviceChain   gr_device_chain[ GR_MAX_DEVICES ];
  int             gr_num_devices = 0;

  static
  grDevice*  find_device( const char*  device_name )
  {
    int  idx = 0;

    if (device_name)
    {
      for ( idx = gr_num_devices-1; idx > 0; idx-- )
        if ( strcmp( device_name, gr_device_chain[idx].name ) == 0 )
          break;
    }

    if ( idx < 0 || gr_num_devices <= 0 || !gr_device_chain[idx].device )
    {
      grError = gr_err_invalid_device;
      return 0;
    }

    return gr_device_chain[idx].device;
  }



 /**********************************************************************
  *
  * <Function>
  *    grGetDeviceModes
  *
  * <Description>
  *    queries the available pixel modes for a device.
  *
  * <Input>
  *    device_name  :: name of device to be used. 0 for the default
  *                    device. For a list of available devices, see
  *                    grInitDevices.
  *
  * <Output>
  *    num_modes    :: number of available modes. 0 in case of error,
  *                    which really is an invalid device name.
  *
  *    pixel_modes  :: array of available pixel modes for this device
  *                    this table is internal to the device and should
  *                    not be freed by client applications.
  *
  * <Return>
  *    error code. 0 means success. invalid device name otherwise
  *
  * <Note>
  *    All drivers are _required_ to support at least the following
  *    pixel formats :
  *
  *    - gr_pixel_mode_mono : i.e. monochrome bitmaps
  *    - gr_pixel_mode_gray : with any number of gray levels between
  *                           2 and 256.
  *
  *    the pixel modes do not provide the number of grays in the case
  *    of "gray" devices. You should try to create a surface with the
  *    maximal number (256, that is) and see the value returned in
  *    the bitmap descriptor.
  *
  **********************************************************************/

  extern void grGetDeviceModes( const char*    device_name,
                                int           *num_modes,
                                grPixelMode*  *pixel_modes )
  {
    grDevice*  device;

    *num_modes   = 0;
    *pixel_modes = 0;

    device = find_device( device_name );
    if (device)
    {
      *num_modes   = device->num_pixel_modes;
      *pixel_modes = device->pixel_modes;
    }
  }


 /**********************************************************************
  *
  * <Function>
  *    grNewSurface
  *
  * <Description>
  *    creates a new device-specific surface. A surface is either
  *    a window or a screen, depending on the device.
  *
  * <Input>
  *    device  :: name of the device to use. A value of NULL means
  *               the default device (which depends on the system).
  *               for a list of available devices, see grInitDevices.
  *
  * <InOut>
  *    bitmap  :: handle to a bitmap descriptor containing the
  *               requested pixel mode, number of grays and dimensions
  *               for the surface. the bitmap's 'pitch' and 'buffer'
  *               fields are ignored on input.
  *
  *               On output, the bitmap describes the surface's image
  *               completely. It is possible to write directly in it
  *               with grBlitGlyphToBitmap, even though the use of
  *               grBlitGlyphToSurface is recommended.
  *
  * <Return>
  *    handle to the corresponding surface object. 0 in case of error
  *
  * <Note>
  *    All drivers are _required_ to support at least the following
  *    pixel formats :
  *
  *    - gr_pixel_mode_mono : i.e. monochrome bitmaps
  *    - gr_pixel_mode_gray : with any number of gray levels between
  *                           2 and 256.
  *
  *    This function might change the bitmap descriptor's fields. For
  *    example, when displaying a full-screen surface, the bitmap's
  *    dimensions will be set to those of the screen (e.g. 640x480
  *    or 800x600); also, the bitmap's 'buffer' field might point to
  *    the Video Ram depending on the mode requested..
  *
  *    The surface contains a copy of the returned bitmap descriptor,
  *    you can thus discard the 'bitmap' parameter after the call.
  *
  **********************************************************************/

  extern grSurface*  grNewSurface( const char*  device_name,
                                   grBitmap*    bitmap )
  {
    grDevice*   device;
    grSurface*  surface;

    /* Now find the device */
    device = find_device( device_name );
    if (!device) return 0;

    surface = (grSurface*)grAlloc( device->surface_objsize );
    if (!surface) return 0;

    if ( !device->init_surface( surface, bitmap ) )
    {
      grFree( (void *)surface );
      surface = 0;
    }
    return surface;
  }



  extern
  void  grDoneSurface( grSurface*  surface )
  {
    if (surface)
    {
      /* first of all, call the device-specific destructor */
      surface->done(surface);

      /* then remove the bitmap if we're owner */
      if (surface->owner)
        grFree( surface->bitmap.buffer );

      surface->owner         = 0;
      surface->bitmap.buffer = 0;
      grFree( surface );
    }
  }


 /**********************************************************************
  *
  * <Function>
  *    grRefreshRectangle
  *
  * <Description>
  *    this function is used to indicate that a given surface rectangle
  *    was modified and thus needs re-painting. It really is useful for
  *    windowed or gray surfaces.
  *
  * <Input>
  *    surface :: handle to target surface
  *    x       :: x coordinate of the top-left corner of the rectangle
  *    y       :: y coordinate of the top-left corner of the rectangle
  *    width   :: rectangle width in pixels
  *    height  :: rectangle height in pixels
  *
  **********************************************************************/

  extern void  grRefreshRectangle( grSurface*  surface,
                                   grPos       x,
                                   grPos       y,
                                   grPos       width,
                                   grPos       height )
  {
    if (surface->refresh_rect)
      surface->refresh_rect( surface, x, y, width, height );
  }



 /**********************************************************************
  *
  * <Function>
  *    grWriteSurfaceChar
  *
  * <Description>
  *    This function is equivalent to calling grWriteCellChar on the
  *    surface's bitmap, then invoking grRefreshRectangle.
  *
  *    The graphics sub-system contains an internal Latin1 8x8 font
  *    which can be used to display simple strings of text without
  *    using FreeType.
  *
  *    This function writes a single 8x8 character on the target bitmap.
  *
  * <Input>
  *    target   :: handle to target surface
  *    x        :: x pixel position of character cell's top left corner
  *    y        :: y pixel position of character cell's top left corner
  *    charcode :: Latin-1 character code
  *    color    :: color to be used to draw the character
  *
  **********************************************************************/

  extern
  void  grWriteSurfaceChar( grSurface* target,
                            int        x,
                            int        y,
                            int        charcode,
                            grColor    color )
  {
    grWriteCellChar( &target->bitmap, x, y, charcode, color );
    if (target->refresh_rect)
      target->refresh_rect( target, x, y, 8, 8 );
  }


 /**********************************************************************
  *
  * <Function>
  *    grWriteSurfaceString
  *
  * <Description>
  *    This function is equivalent to calling grWriteCellString on the
  *    surface's bitmap, then invoking grRefreshRectangle.
  *
  *    The graphics sub-system contains an internal Latin1 8x8 font
  *    which can be used to display simple strings of text without
  *    using FreeType.
  *
  *    This function writes a string with the internal font
  *
  * <Input>
  *    target       :: handle to target bitmap
  *    x            :: x pixel position of string's top left corner
  *    y            :: y pixel position of string's top left corner
  *    string       :: Latin-1 text string
  *    color        :: color to be used to draw the character
  *
  **********************************************************************/

  extern
  void  grWriteSurfaceString( grSurface*  target,
                              int         x,
                              int         y,
                              const char* string,
                              grColor     color )
  {
    int  len;

    len = strlen(string);
    grWriteCellString( &target->bitmap, x, y, string, color );
    if (target->refresh_rect)
      target->refresh_rect( target, x, y, 8*len, 8 );
  }


 /**********************************************************************
  *
  * <Function>
  *    grRefreshSurface
  *
  * <Description>
  *    a variation of grRefreshRectangle which repaints the whole surface
  *    to the screen.
  *
  * <Input>
  *    surface :: handle to target surface
  *
  **********************************************************************/

  extern void  grRefreshSurface( grSurface*  surface )
  {
    if (surface->refresh_rect)
      surface->refresh_rect( surface, 0, 0,
                             surface->bitmap.width,
                             surface->bitmap.rows );
  }



 /**********************************************************************
  *
  * <Function>
  *    grSetTitle
  *
  * <Description>
  *    set the window title of a given windowed surface.
  *
  * <Input>
  *    surface      :: handle to target surface
  *    title_string :: the new title
  *
  **********************************************************************/

  extern void  grSetTitle( grSurface*  surface,
                           const char* title_string )
  {
    if (surface->set_title)
      surface->set_title( surface, title_string );
  }




 /**********************************************************************
  *
  * <Function>
  *    grListenSurface
  *
  * <Description>
  *    listen the events for a given surface
  *
  * <Input>
  *    surface    :: handle to target surface
  *    event_mask :: the event mask (mode)
  *
  * <Output>
  *    event  :: the returned event
  *
  * <Note>
  *    XXX : For now, only keypresses are supported.
  *
  **********************************************************************/

  extern
  int   grListenSurface( grSurface*  surface,
                         int         event_mask,
                         grEvent    *event )
  {
    return surface->listen_event( surface, event_mask, event );
  }


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区日韩视频| 成人手机电影网| 欧美日韩视频一区二区| 亚洲精品视频一区| 欧美在线free| 欧美a级理论片| 欧美不卡一区二区三区| 国产精品资源在线观看| 国产精品久久久久永久免费观看 | 国产美女主播视频一区| 久久蜜桃一区二区| www.久久精品| 天天射综合影视| 2020日本不卡一区二区视频| 成人av在线一区二区三区| 亚洲欧美国产三级| 91精选在线观看| 91亚洲精华国产精华精华液| 亚洲激情男女视频| 欧美高清激情brazzers| 国产剧情一区二区三区| 一区二区三区蜜桃网| 日韩精品一区二区三区在线观看| 国产麻豆一精品一av一免费| 日韩毛片视频在线看| 91精品婷婷国产综合久久竹菊| 黑人巨大精品欧美黑白配亚洲| 国产精品久久久久久亚洲毛片| 欧美性受极品xxxx喷水| 久久99精品久久久久久动态图 | 亚洲男人都懂的| 欧美日本精品一区二区三区| 国产在线一区观看| 亚洲主播在线观看| 久久久久国产成人精品亚洲午夜| 欧美中文字幕一二三区视频| 国产做a爰片久久毛片 | 男男视频亚洲欧美| 中文字幕一区免费在线观看| 日韩一区二区三区在线| 一本久道中文字幕精品亚洲嫩| 蜜桃av噜噜一区| 亚洲三级在线看| 久久精品水蜜桃av综合天堂| 欧美精品日日鲁夜夜添| 成人av电影在线| 久久99国产精品尤物| 亚洲高清不卡在线| 国产精品久久久久影院老司| 日韩视频免费观看高清完整版在线观看| 99久久综合国产精品| 国产在线日韩欧美| 日韩在线一二三区| 亚洲精选视频免费看| 久久免费看少妇高潮| 欧美一级理论性理论a| 色综合久久综合网97色综合| 国产精品亚洲第一区在线暖暖韩国| 日日骚欧美日韩| 亚洲电影第三页| 亚洲精品日日夜夜| 最新日韩av在线| 国产日韩在线不卡| 久久久国产午夜精品| 日韩免费一区二区三区在线播放| 欧美日韩免费观看一区三区| 日本精品裸体写真集在线观看 | 精品午夜久久福利影院| 日本午夜精品视频在线观看 | 久久精品亚洲麻豆av一区二区| 91精品国产91久久久久久一区二区 | 国产精品国产精品国产专区不片 | 欧美一区二区三区不卡| 欧美人与禽zozo性伦| 欧美亚洲日本一区| 欧美三级三级三级爽爽爽| 91福利在线看| 色偷偷一区二区三区| 色综合天天综合网国产成人综合天| 国产成人精品免费| 国产成人福利片| 极品少妇xxxx精品少妇偷拍| 国产一区二区三区观看| 韩国理伦片一区二区三区在线播放| 美国毛片一区二区三区| 麻豆成人免费电影| 国产揄拍国内精品对白| 成人亚洲精品久久久久软件| 国产成人午夜精品影院观看视频| 国产成人h网站| 99精品黄色片免费大全| 欧美午夜理伦三级在线观看| 欧美日本一道本在线视频| 欧美一区二区精品在线| 精品美女在线观看| 久久久久久免费网| 亚洲情趣在线观看| 五月天视频一区| 极品少妇一区二区| voyeur盗摄精品| 欧美主播一区二区三区| 欧美不卡一区二区| 国产精品久久久久aaaa樱花| 一区二区三区精品在线| 日韩高清一级片| 国产一区二区三区久久久| 97久久人人超碰| 欧美日韩国产在线观看| 日韩精品一区二区三区中文不卡 | 久久久亚洲高清| 亚洲天堂中文字幕| 奇米影视一区二区三区| 成人精品gif动图一区| 欧美视频完全免费看| 久久综合资源网| 亚洲欧洲综合另类在线 | 国产九色精品成人porny| 色综合久久综合网| 久久欧美一区二区| 一区二区三区四区不卡视频| 极品少妇xxxx精品少妇偷拍| 色吊一区二区三区| 久久久久久综合| 香蕉久久夜色精品国产使用方法 | 丝袜美腿成人在线| 国产成人综合视频| 欧美高清你懂得| 亚洲男人都懂的| 国产精品综合久久| 56国语精品自产拍在线观看| 国产精品人成在线观看免费| 日韩成人一级大片| 91丨九色丨国产丨porny| 精品少妇一区二区三区在线播放 | 国产欧美1区2区3区| 免费精品视频最新在线| 色网站国产精品| 欧美经典一区二区| 久久精品噜噜噜成人av农村| 欧美主播一区二区三区| 最好看的中文字幕久久| 国产成人午夜视频| 日韩精品一区二| 天堂精品中文字幕在线| 色吊一区二区三区| 国产精品成人免费| 国产一区二区三区在线观看免费视频| 欧美在线一二三四区| 国产精品久久一卡二卡| 国产成人免费视频网站高清观看视频 | 美女脱光内衣内裤视频久久网站| 色综合久久中文综合久久牛| 国产精品免费网站在线观看| 国产麻豆一精品一av一免费| 欧美成人一区二区三区片免费| 午夜精品福利一区二区三区av| 色琪琪一区二区三区亚洲区| 中文字幕永久在线不卡| 成人免费观看男女羞羞视频| 国产日韩成人精品| 国产在线观看免费一区| 精品久久五月天| 狠狠色丁香久久婷婷综合_中| 日韩欧美中文字幕精品| 老司机免费视频一区二区三区| 91精品国产综合久久久久| 日韩精品一级二级| 欧美一区二区播放| 捆绑调教美女网站视频一区| 日韩视频在线观看一区二区| 青青草91视频| 2017欧美狠狠色| 高清beeg欧美| 国产精品久久三区| 色先锋资源久久综合| 亚洲午夜电影网| 91麻豆精品国产91久久久久久| 日韩中文欧美在线| 精品久久久久久久人人人人传媒 | 高清av一区二区| 国产精品三级在线观看| 99精品热视频| 亚洲第一久久影院| 欧美一区二区三区视频| 国产一区二区毛片| 亚洲国产电影在线观看| 91蜜桃免费观看视频| 亚洲电影一区二区三区| 91精品免费在线观看| 国产精品888| 亚洲久草在线视频| 日韩一级片在线播放| 成人在线一区二区三区| 亚洲一区二区四区蜜桃| 欧美一级午夜免费电影| 成人一区二区三区| 夜夜嗨av一区二区三区网页 | 国产高清不卡一区| 亚洲婷婷在线视频| 日韩一区二区三区在线观看 |