您的位置:首页 > 其它

SVGALib

2016-04-11 11:58 399 查看
SVGALib是一套运行于Linux及FreeBSD下的开放源代码低阶绘图函式库,它允许程式设计人员变更视讯模式及全屏幕图像,许多热门的电脑游戏如Quake及Doom都源自此技术。


范例

编辑

#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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: