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;
}
范例
编辑#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;
}
相关文章推荐
- 中文和英文的比较
- Mysql非安装版的安装使用相关问题
- knockout.js
- 这些小工具让你的Android 开发更高效
- PHP实现的浏览器检查类
- 关于 Java 中 finally 语句块的深度辨析
- 有上下界的网络流
- OpenGL之坐标转换(好文-清晰版)
- 测试驱动开发(TDD)在海外组的实践总结
- OpenCV中cvADDS()为啥第二个参数要是CvScalar类型?mask=NULL又是何意?
- LeetCode 14. Longest Common Prefix
- 【day0411 C++】字符串流istringstream和ostringstream的用法
- ZZULI 1868: UP UP UP!【dp】
- 决策树的数学原理
- vsftp登陆错误530login incorrect及500 oops问题解决
- C++多重继承
- 开源Registry项目Harbor源代码结构解析
- ASP.NET中在后台用C#,往前台插入HTML代码
- 寻梦南非 我心飞翔
- <iOS>cannot be opened because the project file cannot be parsed. Xcode工程文件打不开..