X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=docs%2Freference%2Fglk-main-function.sgml;h=a1fef408650e7684aa9c0392afb210425afd2ccc;hb=28c6b69cb8e971a9959066fe896edcc4ae412935;hp=e6f33e76855604bea92f5c18deb6b254cd7d4501;hpb=904fed6618b22e84597efd60c3784e57d44f3ef1;p=projects%2Fchimara%2Fchimara.git
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.