SVGALib
Encyclopedia
SVGAlib is an open-source low-level graphics library which runs on Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 and FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

 and allows programs to change video mode and display full-screen graphics. Some popular games like Quake and Doom used it in their original releases.

The library was popular in mid-1990s. Toward 2000, many applications that used it migrated to X11
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

 and SDL
Simple DirectMedia Layer
Simple DirectMedia Layer is a cross-platform, free and open source multimedia library written in C that presents a simple interface to various platforms' graphics, sound, and input devices....

, which itself can make use of SVGAlib as a video driver.

A sample of SVGAlib code is shown below.

  1. include
  2. include
  3. include


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

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK