From 06ddf48408b645a395390ba543f2cb241826896f Mon Sep 17 00:00:00 2001 From: "P. F. Chimento" Date: Tue, 19 Apr 2011 18:26:29 +0200 Subject: [PATCH] Fix program listing --- docs/reference/glk-main-function.sgml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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. -- 2.30.2