SVGALib
svgalib是一套运行于Linux及FreeBSD下的开放原代码低级绘图函数库,它允许编程人员变更视频模式及全屏幕图像,许多热门的电脑游戏如Quake及Doom都源自此技术。
原作者 | Harm Hanemaayer |
---|---|
编程语言 | C |
操作系统 | Linux, FreeBSD |
平台 | x86, x86-64 |
类型 | 库 |
网站 | www |
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;
}
参见
- General Graphics Interface (GGI)
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.