From: P. F. Chimento Date: Tue, 19 Apr 2011 16:26:29 +0000 (+0200) Subject: Fix program listing X-Git-Tag: v0.9~104 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=06ddf48408b645a395390ba543f2cb241826896f;p=projects%2Fchimara%2Fchimara.git Fix program listing --- diff --git a/docs/reference/glk-main-function.sgml b/docs/reference/glk-main-function.sgml index e6f33e7..a1fef40 100644 --- a/docs/reference/glk-main-function.sgml +++ b/docs/reference/glk-main-function.sgml @@ -33,13 +33,12 @@ You define a function called glk_main(), which the library calls to begin runnin Glk does all its user-interface work in a function called glk_select(). This function waits for an event — typically the player's input — and returns an structure representing that event. This means that your program must have an event loop. In the very simplest case, you could write - - +|[ void glk_main() { - #event_t ev; + event_t ev; while (1) { - #glk_select(&ev); + glk_select(&ev); switch (ev.type) { default: /* do nothing */ @@ -47,8 +46,7 @@ void glk_main() } } } - - +]| This is a legal Glk-compatible program. As you might expect, it doesn't do anything. The player will see an empty window, which he can only stare at, or destroy in a platform-defined standard manner.