5 #include "chimara-glk.h"
6 #include "chimara-glk-private.h"
8 ChimaraGlkPrivate *glk_data = NULL;
13 * Shuts down the Glk program. This function does not return.
15 * If you print some text to a window and then shut down your program, you can
16 * assume that the player will be able to read it.
19 * You should only shut down your program with glk_exit() or by returning from
20 * your glk_main() function. If you call the ANSI <function>exit()</function>
21 * function, bad things may happen. This Glk library is designed for multiple
22 * sessions, for example, and you would be cutting off all the sessions instead
23 * of just yours. You would also prevent final text from being visible to the
37 * Many platforms have some annoying thing that has to be done every so often,
38 * or the gnurrs come from the voodvork out and eat your computer.
40 * Well, not really. But you should call glk_tick() every so often, just in
41 * case. It may be necessary to yield time to other applications in a
42 * cooperative-multitasking OS, or to check for player interrupts in an infinite
45 * This call is fast; in fact, on average, it does nothing at all. So you can
46 * call it often. (In a virtual machine interpreter, once per opcode is
47 * appropriate. In a program with lots of computation, pick a comparable rate.)
49 * glk_tick() does not try to update the screen, or check for player input, or
50 * any other interface task. For that, you should call glk_select() or
53 * Basically, you must ensure there's some fixed upper bound on the amount of
54 * computation that can occur before a glk_tick() (or glk_select()) occurs. In a
55 * VM interpreter, where the VM code might contain an infinite loop, this is
56 * critical. In a C program, you can often eyeball it.
63 /* Do one iteration of the main loop if there are any events */
65 if(gtk_events_pending())