Linux程式设计入门 - SVGALIB |
|
|
SvgaLib是Linux
Console下的VGA驱动函数库。虽然它的品质还是有点低,支援的萤幕卡种类不算太多,但是有许多的游戏及程式都是用它来做开发,可以算是非官方的标准了。如果您准备要在Console下撰写图形功能的程式,目前来说SVGALIB是您唯一的选择。目前使用SVGALIB的程式有许多,中文终端机使用SVGALIB的就有a4c.tty/yact/bcs16。
这里我只讲一些简单的使用方法,如启动vga及mouse的使用。要有效地、高阶的运用,技巧复杂很多,例如a4c.tty就另外往上架一层Star Window Manager,来管理一个小型视窗系统。
vga
vgamouse
int vga_setmode(int mode);
int vga_hasmode(int mode);
int vga_setpalette(int index, int red, int green, int blue);
int vga_getpalette(int index, int *red, int *green, int *blue);
int vga_setcolor(int color);
int vga_drawpixel(int x, int y);
int vga_drawline(int x1, int y1, int x2, int y2);
int vga_getpixel(int x, int y);
vga_modeinfo *vga_getmodeinfo(int mode);
unsigned char *graph_mem;
unsigned char *vga_getgraphmem(void);
void vga_setpage(int p);
void vga_setreadpage(int p);
void vga_setreadpage(int p);
void vga_ < 1 > < 2 > |
|
|
在百度搜索:Linux程式设计入门 - SVGALIB
|