DOS下用什么来制作图形?
哪些库用于在 DOS(控制台)上制作 2D/3D 图形和图形用户界面?我指的是《德军总部 3D》、《暗影武士》等游戏中使用的糟糕图形。
What libraries were/are used to make 2D/3D graphics and Graphical User Interface on DOS(console) ? I mean the poor graphic that was used in games like Wolfenstein 3D, Shadow Warrior, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
硬件加速的想法直到 Windows 时代才真正流行起来。因此,大多数显卡运行的模式都是将大型内存阵列映射到特定的地址范围。因此,您可以将数字插入某些位置,这会导致像素发生相应的变化。
setPixel
风格的操作通常必须从显卡读取信息,以屏蔽信息以确保它只破坏单个像素。将相邻像素的范围填充在一起以避免读/屏蔽/写周期要快得多。 VGA 卡上臭名昭著的“mode 13h”特别方便,因为每个字节对应一个独立的 256 色像素:http://en.wikipedia.org/wiki/Mode_13h
有一个不同库的大杂烩——大部分是专有的——实现了可以在不同图形中工作的快速直线或圆形绘制算法模式。例如,有 Genus Microprogramming 的 GX Graphics 和 Ted Gruber 的 Fastgraph (显然今天仍然存在)。按照今天的标准,这些并不是什么花哨的东西,但在以下方面肯定击败了 Borland 图形界面表现。
这些库在当时的编程杂志上售价为数百美元。那个时代的风气通常比新一代程序员所希望的更加神秘……这意味着即使您购买了这些库之一,您也可能无法获得源代码,除非您支付更多费用。当然,游戏公司也不希望竞争对手知道他们使用了什么或者他们内部开发了多少。
在 DOS 时代后期,ModeX 库的到来预示着一些新的未记录的视频模式和有趣的技巧(如“编译位图”)。这些通常是开源的,并由演示场景中的人们通过互联网共享:
http://www.ascotti .org/programming/modex.htm
The idea of hardware acceleration didn't really catch on until around the days of Windows. So most graphics cards ran in modes that were simply large arrays of memory mapped into specific address ranges. So you'd poke numbers into certain locations and that would cause corresponding changes to the pixels.
A
setPixel
style operation would often have to read information off the graphics card in order to mask the information to make sure it only disrupted a single pixel. It was a lot faster to fill ranges of adjacent pixels together to avoid the read/mask/write cycle. The infamous "mode 13h" on VGA cards was especially convenient, because each byte corresponded to an independent 256-color pixel:http://en.wikipedia.org/wiki/Mode_13h
There were a hodgepodge of different libraries--mostly proprietary--that implemented fast line or circle drawing algorithms which would work in different graphics modes. For instance, there was Genus Microprogramming's GX Graphics and Ted Gruber's Fastgraph (which is apparently still around today). By today's standards these were nothing fancy, but certainly trounced the likes of the Borland Graphics Interface in terms of performance.
These libraries were marketed for hundreds of dollars in programming magazines of the time. The ethos of that era generally was much more secretive than the new generation of programmers like to be...which means even if you bought one of these libraries you probably didn't get the source code, unless you paid even more. And certainly game companies didn't want competitors to know what they used or how much they'd developed in-house.
Late in the DOS days the arrival of the ModeX libraries heralded in some new undocumented video modes, and interesting tricks (like "compiled bitmaps"). These were often open source and shared over the Internet by people in the demoscene:
http://www.ascotti.org/programming/modex.htm
Graphics.h 是一个非标准的 Borland 扩展,许多旧的图形游戏都使用它。它远远超出了基于文本的终端的正常限制,但仅受 16 位系统支持,而 Microsoft 几乎已从 Windows 中删除了对 16 位系统的支持。您还需要一个古老的 Borland 编译器,或者一个模拟器。
graphics.h, a non-standard Borland extension is something that a lot of older graphical games used to use. It goes far beyond the normal limits of the text based terminal, but is only supported by 16 bit systems, of which Microsoft has all but removed support for from Windows. You'd also need an ancient Borland compiler, or an emulation.