SVGALib

對HuaTaiLohankhapedia
Kàu tō-lám 跳至搜尋
SVGALib
原作者Harm Hanemaayer
眼前版本1.4.3(2001年6月2日,​25年前​(2001-06-02))
預覽版本1.9.25
源代碼庫
  • {{URL|example.com|可选的显示文本}}
編程言語C
ia̋n-jín
    作業系統Linux, FreeBSD
    平台x86, x86-64
    分類庫
    容允協議
      網站www.svgalib.org

      Svgalib是一套運轉佇Linux佮Free BSD下的開放原始碼低坎繪圖函式庫,伊准程式設計人員變更視訊模式佮全螢幕圖像,真濟熱門的電腦遊戲如Quake佮Doom攏源自這技術。

      Svgalib佇1990年代中期開始並遍,毋過到2000年了後,多數使用此技術的應用攏漸次移轉到X11 and SDL(Simple Direct Media Layer)頂面。

      本函式庫足容易使用的,會當參考以下程式範例片段:

      <syntaxhighlight lang="c">

      1. include <stdlib.h>
      2. include <unistd.h>
      3. include <vga.h>

      int main(void) {

        int color = 4;
        int x = 10;
        int y = 10;
        unsigned int seconds = 5;
      
        /* detect the chipset and give up supervisor rights */
        if (vga_init() < 0)
             return EXIT_FAILURE;
      
        vga_setmode(G320x200x256);
        vga_setcolor(color);
        vga_drawpixel(x, y);
      
        sleep(seconds);
      
        /* restore textmode and fall back to ordinary text console handling */
        vga_setmode(TEXT);
      
        return EXIT_SUCCESS;
      

      } </syntaxhighlight>