2002.11.20 ~08 Blue skies: vt100, ncurses, and Q3VM. Firstly, I wanted a way to place random text on a random location on the screen at random times. There is already a function in cgame for this functionality. A problem arises if I need to shift the location. If done in all-C, the module needs to be recompiled. Alternatively, I could write a QuakeScheme wrapper so the position is adjustable from Scheme... but if I wrap DrawString(), why not DrawChar()? And the cell-measuring functions? How about the whole font system? Then there's the cvars method, but then comes the question of having more than one string to draw. Have a set of cvars like "string0loc", "string1loc", "string2loc"? Or the dimensions laid out like "0:20:foo" in a cvar? I can see this method getting very very messy. I got around to thinking about cells-based positioning, like a tty with an addressable cursor. Row 3, Column 42. First model that came to my mind was vt100. One possibility presented by an addressable-cursor screen is a full-screen text editor. In real life, there already is a full-screen text editor with a Lisp back-end. Or rather, a full-screen Lisp acting as a text editor. Anyone moderately involved with text mode is likely to be familiar with the curses library, which helps utilize an addresssable cursor terminal by presenting a terminal-independent interface (an API). The curses API is fairly well-established in the area of text mode, and so is a useful basis for C-coding to a full-screen text mode in Q3. One of the free implementations of the curses interface is "ncurses", which is part of the GNU system and thus why its most familiar to me. As an aside, the Q3 UI is based on a 640x480 units coordinate system regardless of resolution (and scaled up to current screen resolution); character cells are 8x16 units. This yields a textscreen resolution of 80 cells horizontal and 30 cells vertical. If I can whip up the necessary glue code to attach ncurses to Q3VM, other potentials open up. For one, ncurses also comes with a text windowing system. In a pinch, the ncurses windowing system can fill in as a half-baked forms GUI. Porting (or rather gluing in...) ncurses also allows porting ncurses-based programs to Q3VM. Such as... err... um... tetris??... Well, here is one far-fetched possibility arising from getting in ncurses: Q3nethack.