SVGALib
{{Short description|Linux graphics library}}
{{Infobox software
| name = SVGAlib
| logo =
| screenshot =
| caption =
| collapsible =
| developer = Matan Ziv-Av
| released =
| latest release version = 1.4.3
| latest release date = {{start date and age|2001|06|02}}{{cite web |title=SVGALIB |url=http://my.svgalib.org/svgalib/ |access-date=16 October 2022}}
| latest preview version = 1.9.25
| latest preview date =
| programming language = C
| operating system = AmigaOS, Linux, FreeBSD
| genre = Library
| license =
| website = {{URL|https://www.svgalib.org}}
}}
SVGAlib is an open-source low-level graphics library which ran on AmigaOS, Linux and FreeBSD and allowed programs to change video mode and display full-screen graphics, without the use of a windowing system.{{cite web |last1=Link |first1=Jay |title=SVGAlib Tutorials |url=http://www.svgalib.org/jay/beginners_guide/beginners_guide.html |website=www.svgalib.org |access-date=16 October 2022}}{{cite web|url=https://www.developer.com/guides/easy-graphics-a-beginners-guide-to-svgalib/|website=Developer.com|title=Easy graphics: A beginner's guide to SVGAlib|first=Jay|last=Link|date=1999-09-30|access-date=2023-09-29}} Alongside X11 and the General Graphics Interface, it was one of the earliest libraries allowing graphical video games on Linux.
History
The first version of SVGALib was based on version 1.2 of another library, VGALib by Tommy Frandsen.{{cite web |title=svgalib(7): low level graphics library for - Linux man page |url=https://linux.die.net/man/7/svgalib |website=linux.die.net |access-date=16 October 2022}}
Several games like Ambrosia Software's Maelstrom by Sam Lantinga, the first-person games Freaks! and Space Plumber{{cite web |last=Wilson |first=Hamish | date=2024-09-03 | title=Building a Retro Linux Gaming Computer Part 43: Demons and Angels | url=https://www.gamingonlinux.com/2024/09/building-a-retro-linux-gaming-computer-part-43-demons-and-angels/ | website=GamingOnLinux | accessdate=2024-09-04}}{{cite web|url=https://nixbit.com/software/space-plumber-1.1.0-review/|title=Space Plumber 1.1.0 RC1 review|website=Nixbit|access-date=2023-09-29}} using the QDGDF library,{{cite web|url=https://triptico.com/software/qdgdf.html|author=TTC Development Team|date=2001-01-01|title=Quick and Dirty Game Development Framework|access-date=2024-06-07}}{{cite web|url=https://nixbit.com/software/quick-and-dirty-game-development-framework-review/|title=Quick and Dirty Game Development Framework 0.9.1 review |website=Nixbit|access-date=2024-06-07}} and most famously id Software's Doom (alongside an X11 version) and Quake (after the submission of a third-party patch based on leaked source code{{cite web |last=Wilson |first=Hamish | date=2023-02-27 | title=Building a Retro Linux Gaming Computer - Part 27: Lost Souls | url=https://www.gamingonlinux.com/2023/02/building-a-retro-linux-gaming-computer-part-27-lost-souls/ | website=GamingOnLinux | accessdate=2023-02-27}}) were ported to use SVGALib from other operating systems,{{cite web|url=https://dl.acm.org/doi/fullHtml/10.5555/327469.327475|title=Porting MS-DOS Graphics Applications|first=Jawed|last=Karim|website=ACM|access-date=2023-09-29}} as was Doom porter Dave Taylor's Abuse.
Wolfenstein 3D was also ported following its source code being released in 1995,{{cite web|url=https://newwolf.sourceforge.net/links.htm|title=Wolfenstein3D Links|website=NewWolf|publisher=SourceForge|author=DarkOne|date=2005-04-10|access-date=2023-09-26|quote=Linux Wolf - Runs either in a window (xwolf3d) or with svgalib (swolf3d).}} as well as the id produced Heretic, Hexen and Hexen II after 1999,{{cite web|url=https://www.gamingonlinux.com/2022/03/building-a-retro-linux-gaming-computer-part-16-we-are-all-doomed/|title=Building a Retro Linux Gaming Computer - Part 16: We Are All Doomed|first=Hamish|last=Wilson|date=2022-03-15|access-date=2023-09-29|website=GamingOnLinux}} and Descent and Descent II by Parallax Software after 1998.{{cite web|url=https://www.linuxquestions.org/questions/linux-newbie-8/can-only-run-d1x-as-root-166902/|title=can only run d1x as root!|date=2004-04-06|author=ptesone|website=Linux Questions|access-date=2023-10-04}} Certain source ports for Doom, Quake, and Abuse maintained support for SVGALib.{{cite web|url=https://www.gamingonlinux.com/2023/11/building-a-retro-linux-gaming-computer-part-34-abusing-the-system/|title=Building a Retro Linux Gaming Computer Part 34: Abusing the System|first=Hamish|last=Wilson|date=2023-11-06|access-date=2023-11-07|website=GamingOnLinux}} The library is also supported by the MAME/MESS emulator.{{cite web|url=https://easymamecab.mameworld.info/html/svgalib.htm|title=SVGAlib help|website=Easy MAMECab|access-date=2023-12-07}}
First party Linux games that have supported it include Alizarin Tetris,{{cite web|url=http://www.the-underdogs.org/game.php?id=3920|archive-date=2006-01-03|archive-url=https://web.archive.org/web/20060103160637/http://www.the-underdogs.org/game.php?id=3920|title=Alizarin Tetris|website=Home of the Underdogs|access-date=2023-09-29}} Bdash,{{cite web|url=http://www.bd-fans.com/FreewareUnix.html|title=Freeware Boulder Dash Clones - Unix|website=Boulderdash - Martijn's Boulder Dash Fan Site|access-date=2023-11-07|quote=A Linux clone of Boulder Dash with 256 colour graphics and digitized sounds. It requires the svgalib library.}} Fleuch,{{cite web|url=https://www.linuxjournal.com/article/3798?page=0,1|website=Linux Journal|first=Jason|last=Kroll|title=GAMES FOCUS|date=2000-01-31|access-date=2023-12-18}} Hatman,{{cite web|url=https://www.gamingonlinux.com/2023/12/building-a-retro-linux-gaming-computer-part-36-entertainment-for-x-windows/|title=Building a Retro Linux Gaming Computer Part 36: Entertainment for X Windows|first=Hamish|last=Wilson|website=GamingOnLinux|date=2023-12-12|access-date=2023-12-15|quote=Hatman - The Game of Kings is an impressive but undercooked SVGAlib clone of Pacman which does have an RPM package on the disc but sadly had sound support disabled at compilation. There were a number of other Pacman clones featured, but this one had the most potential.}} Intelligent FRAC,{{cite web|url=https://www.icewalkers.com/linux/software/512360/Intelligent-FRAC-(ifrac).html|title=Intelligent FRAC|website=Ice Walkers|date=2003-11-20|access-date=2023-09-29}} Koules,{{cite web|url=http://web.mit.edu/~linux/redhat/redhat-5.2/i386/doc/rhmanual/manual/doc067.htm|title=Impressing Your Friends with RPM|website=Official Red Hat Linux FAQ|publisher=Massachusetts Institute of Technology|access-date=2023-09-29}} LinCity,{{cite web|url=https://www.csse.uwa.edu.au/programming/linux/Linux-HowTo-9/Ecology-HOWTO-12.html|title=Games|website=Linux Ecology HOWTO|first1=Werner|last1=Heuser|first2=Wade W.|last2=Hampton|date=2003-02-27|access-date=2023-09-29|quote=lincity build & maintain a city/country. You are required to build and maintain a city. You must feed, house, provide jobs and goods for your residents. You can build a sustainable economy with the help of renewable energy and recycling, or you can go for broke and build rockets to escape from a pollution ridden and resource starved planet, it's up to you. Due to the finite resources available in any one place, this is not a game that you can leave for long periods of time. This game is similar to the commercial simulation game with a similar name. This package provides files common to both the X and SVGALIB versions of the game.}}{{cite web|url=https://www.gamingonlinux.com/2023/09/building-a-retro-linux-gaming-computer-part-32-two-steps-forward-one-step-back/|title=Building a Retro Linux Gaming Computer Part 32: Two Steps Forward, One Step Back|first=Hamish|last=Wilson|date=2023-09-04|access-date=2023-09-29|quote=As well as not being in keeping with the aesthetic, the LCD also had the annoying habit of showing a warning about being out of range on top of what otherwise looked to be a workable display, especially when playing games that utilized SVGAlib for graphics. I could get around this by launching certain more pliant SVGAlib games such as the final build of LinCity before starting up the offending applications, as for whatever reason this would seem to soothe the nerves of the display, but I was more than happy to leave those headaches behind.}} Linberto,{{cite web|url=https://happypenguin.altervista.org/sheet.php?gameid=235|title=Linberto|website=The Linux Game Tome|date=2001-04-05|access-date=2023-09-29}} Quadra,{{cite web|url=https://www.icewalkers.com/linux/software/54020/Quadra.html|title=Qundra|website=Ice Walkers|date=2012-02-26|access-date=2023-09-29}} Repton,{{cite web|url=http://www.keelhaul.me.uk/krepton/|title=KRepton version 4 |first=Jonathan|last=Marten|date=2015-12-08|access-date=2023-09-29|quote=KRepton was originally written by Sandro Sigala for Linux using the SVGAlib library, and then rewritten entirely using the QT and KDE libraries for release 1.0 of KDE.}} SABRE,{{cite web|url=https://linuxgazette.net/issue30/ayers3.html|website=Linux Gazette|title=Sabre: An Svgalib Flight Sim|first=Larry|last=Ayers|date=1998-07-01|access-date=2023-09-29}} Thrust (also supported GGI),{{cite web|url=https://www.linkedin.com/pulse/open-game-source-inertia-blast-dennis-payne|title=Open Game Source: Inertia Blast|first=Dennis|last=Payne|date=2021-09-20|access-date=2023-09-29|website=LinkedIn|quote=When I first installed Linux I stumbled on a remake of Thrust. It was brutally difficult but I enjoyed the game. At the time I ran it under svgalib, an old console graphic system which required root access.}} Zarch,{{cite web|url=http://thom.best.vwh.net/software.html#zarch|archive-url=https://web.archive.org/web/20160303194753/http://thom.best.vwh.net/software.html#zarch|title=Software|first=Thom|last=Van Os|website=Thom's Toys|access-date=2023-12-18|archive-date=2016-03-03}} and Zblast,{{cite web|url=https://community.linuxmint.com/software/view/zblast-svgalib|title=zblast-svgalib|website=Linux Mint|access-date=2023-09-29}} among others.{{cite web|url=https://www.ibiblio.org/pub/historic-linux/ftp-archives/sunsite.unc.edu/Sep-29-1996/games/video/INDEX.html|title=Index of /pub/Linux/games/video|website=ibiblio|access-date=2023-09-29}}{{cite web|url=https://linux.die.net/man/7/svgalib|title=svgalib(7) - Linux man page|website=die.net|first=Michael|last=Weller|access-date=2023-09-29}}{{cite web|url=http://web.mit.edu/~linux/redhat/redhat-5.2/i386/doc/rhmanual/manual/doc101.htm|title=Games|website=Official Red Hat Linux FAQ|publisher=Massachusetts Institute of Technology|access-date=2023-09-29}}
SVGALib was popular in the mid to late 1990s.{{cite web|url=https://www.linuxjournal.com/article/3278|website=Linux Journal|title=Linux 2.2 and the Frame-Buffer Console Software|first=Joseph|last=Pranevich|date=1999-04-01|access-date=2023-09-29|quote=Limitations aside, SVGALib has proven to be a stable and popular solution to the console problem and is the primary interface used in Quake and other games.}}{{cite web|url=https://www.gamedeveloper.com/pc/bonus-interview-the-state-of-linux-gaming-|website=Game Developer|title=Bonus Interview: 'The State Of... Linux Gaming?'|first=Alistair|last=Wallis|date=2008-05-26|access-date=2023-09-29|quote=I've always been a video game nerd, so it was important to me to see how much gaming I could do on this new system. I remember how exciting it was to get Doom running fullscreen - [graphics library] svgalib was a monster that I'm sure nobody misses today. I was also quite taken by Maelstrom, a Linux port of a slick Asteroids clone for the Mac.}} A reference book, Linux Graphics Programming with SVGAlib, was authored by Jay Link in 2000.{{cite web|url=https://developers.slashdot.org/story/00/10/24/1937235/linux-graphics-programming-with-svgalib|title=Linux Graphics Programming with SVGAlib|author=timothy|date=2000-10-26|access-date=2023-09-29|website=Slashdot}} Around the turn of the millennium, many applications that used it migrated to X11 and SDL,{{cite web|url=https://happypenguin.altervista.org/sheet.php?gameid=749|title=SDL Sasteroids|website=The Linux Game Tome|date=2005-04-01|access-date=2023-09-29|quote=SDL Sasteroids is a major revision to the original sasteroids game to allow it to run on modern systems. In addition to providing very similar gameplay to the original sasteroids game, a few surprises and updates have been inserted to make it fun for new and old fans. :) Sasteroids was originally an Asteroids game written for svgalib.}} which could (until SDL 2.0) make use of SVGAlib as a video driver.{{cite web |title=FAQ: Using SDL |url=https://wiki.libsdl.org/FAQUsingSDL |website=wiki.libsdl.org}}{{cite web|url=https://www.zerker.ca/home/old-x-games.html|website=Zerk Zone|first=Ryan|last=Armstrong|title=Old X Games|date=2020-11-18|access-date=2023-09-29|quote=That said, I will probably post info on SVGAlib games in the future, as they were a fascinating and forgotten stepping stone towards SDL.}} This was in part due to the risks of privilege escalation due to SVGAlib requiring applications to run from root.{{cite web|url=https://www.exploit-db.com/exploits/20517|title=Itetris 1.6.1/1.6.2 - Privileged Arbitrary Command Execution|website=Exploit Database|date=2000-12-19|access-date=2023-09-29}}{{cite web|url=https://www.gamingonlinux.com/2023/02/building-a-retro-linux-gaming-computer-part-27-lost-souls/|title=Building a Retro Linux Gaming Computer - Part 27: Lost Souls|first=Hamish|last=Wilson|website=GamingOnLinux|date=2023-02-27|access-date=2023-09-29}}{{cite web|url=https://www.linuxdoc.org/HOWTO/Quake-HOWTO-2.html|title=Linux Quake HOWTO|first=Bob|last=Zimbinski|version=0.1.14|date=1998-08-30|access-date=2023-09-29|quote=Quake and QuakeWorld servers can be run by any user. The Quake clients, however, need access to your sound and graphics cards, which requires privileges that normal users don't have. One (bad) way to deal with this is to always run Quake as root. Responsible system administrators will cringe at this filthy suggestion. Making the Quake binaries setuid root is a more acceptable solution. Quake can then be run by regular users and still have the privileges it needs to access the sound and graphics devices. Setuid presents a security risk, though. A clever user could exploit a bug or security hole in Quake to gain root access to your system. Of course, if you don't run a multi-user system, this is may not be a big concern.}}
References
{{Reflist}}
External links
- [https://www.svgalib.org/ SVGAlib]
- [https://svgalib.org/matan/svgalib Development versions] (link on the site itself is broken)
- [https://www.uvlist.net/groups/info/svgalib SVGAlib - Universal Videogames List]
{{DEFAULTSORT:Svgalib}}
Category:Articles with example C code