SVGALib

维基百科,自由的百科全书
跳转到导航 跳转到搜索
SVGALib
原作者Harm Hanemaayer
当前版本1.4.3(2001年6月2日,​25年前​(2001-06-02
预览版本1.9.25
源代码库
  • {{URL|example.com|可选的显示文本}}
Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
编程语言C
引擎
    Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
    操作系统Linux, FreeBSD
    平台x86, x86-64
    类型
    许可协议
      Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
      网站www.svgalib.org

      svgalib是一套运行于LinuxFreeBSD下的开放源代码低阶绘图函式库,它允许程式设计人员变更视讯模式及全萤幕图像,许多热门的电脑游戏如QuakeDoom都源自此技术。

      svgalib在1990年代中期开始并遍,但到2000年之后,多数使用此技术的应用都渐次转移到了X11 and SDL(Simple DirectMedia Layer)上。

      本函式库很容易使用,可以参考以下程式范例片段:

       
      #include <stdlib.h>
      #include <unistd.h>
      #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;
      }
      

      参见[编辑]

      外部链接[编辑]