]> git.sur5r.net Git - cc65/blobdiff - doc/tgi.sgml
Merge pull request #829 from inexorabletash/string-escapes
[cc65] / doc / tgi.sgml
index 3bab58f571c74bb1c2c248ffeb9a83924af87adc..c5878622e31e5216725597baa27d0f76756176cd 100644 (file)
@@ -2,64 +2,20 @@
 
 <article>
 <title>Tiny Graphics Interface
-<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
-<date>2017-11-23
+<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
+<url url="mailto:polluks@sdf.lonestar.org" name="Stefan A. Haubenthal">,<newline>
+<url url="mailto:greg.king5@verizon.net" name="Greg King">
 
 <abstract>
 The cc65 library provides functions for platform independent graphics.
-Include the tgi.h header file to get the necessary definitions.
+Include the tgi.h header file to get the necessary definitions, see also
+<tt>samples/tgidemo.c</tt> and <tt>samples/mandelbrot.c</tt>.
 </abstract>
 
-<!-- Table of contents -->
-<itemize>
-<item><ref id="tgi_arc" name="tgi_arc">
-<item><ref id="tgi_bar" name="tgi_bar">
-<item><ref id="tgi_circle" name="tgi_circle">
-<item><ref id="tgi_clear" name="tgi_clear">
-<item><ref id="tgi_done" name="tgi_done">
-<item><ref id="tgi_ellipse" name="tgi_ellipse">
-<item><ref id="tgi_free_vectorfont" name="tgi_free_vectorfont">
-<item><ref id="tgi_getaspectratio" name="tgi_getaspectratio">
-<item><ref id="tgi_getcolor" name="tgi_getcolor">
-<item><ref id="tgi_getcolorcount" name="tgi_getcolorcount">
-<item><ref id="tgi_getdefpalette" name="tgi_getdefpalette">
-<item><ref id="tgi_geterror" name="tgi_geterror">
-<item><ref id="tgi_geterrormsg" name="tgi_geterrormsg">
-<item><ref id="tgi_getmaxcolor" name="tgi_getmaxcolor">
-<item><ref id="tgi_getmaxx" name="tgi_getmaxx">
-<item><ref id="tgi_getmaxy" name="tgi_getmaxy">
-<item><ref id="tgi_getpagecount" name="tgi_getpagecount">
-<item><ref id="tgi_getpalette" name="tgi_getpalette">
-<item><ref id="tgi_getpixel" name="tgi_getpixel">
-<item><ref id="tgi_gettextheight" name="tgi_gettextheight">
-<item><ref id="tgi_gettextwidth" name="tgi_gettextwidth">
-<item><ref id="tgi_getxres" name="tgi_getxres">
-<item><ref id="tgi_getyres" name="tgi_getyres">
-<item><ref id="tgi_gotoxy" name="tgi_gotoxy">
-<item><ref id="tgi_init" name="tgi_init">
-<item><ref id="tgi_install" name="tgi_install">
-<item><ref id="tgi_install_vectorfont" name="tgi_install_vectorfont">
-<item><ref id="tgi_ioctl" name="tgi_ioctl">
-<item><ref id="tgi_line" name="tgi_line">
-<item><ref id="tgi_lineto" name="tgi_lineto">
-<item><ref id="tgi_load_driver" name="tgi_load_driver">
-<item><ref id="tgi_load_vectorfont" name="tgi_load_vectorfont">
-<item><ref id="tgi_outtext" name="tgi_outtext">
-<item><ref id="tgi_outtextxy" name="tgi_outtextxy">
-<item><ref id="tgi_setaspectratio" name="tgi_setaspectratio">
-<item><ref id="tgi_setcolor" name="tgi_setcolor">
-<item><ref id="tgi_setdrawpage" name="tgi_setdrawpage">
-<item><ref id="tgi_setpalette" name="tgi_setpalette">
-<item><ref id="tgi_setpixel" name="tgi_setpixel">
-<item><ref id="tgi_setviewpage" name="tgi_setviewpage">
-<item><ref id="tgi_settextscale" name="tgi_settextscale">
-<item><ref id="tgi_settextstyle" name="tgi_settextstyle">
-<item><ref id="tgi_uninstall" name="tgi_uninstall">
-<item><ref id="tgi_unload" name="tgi_unload">
-</itemize>
-
 <!-- Begin the document -->
 
+<sect>tgi.h<label id="tgi.h">
+
 <sect1>tgi_arc<label id="tgi_arc"><p>
 
 <quote>
@@ -447,6 +403,46 @@ be used in presence of a prototype.
 </quote>
 
 
+<sect1>tgi_gettextheight<label id="tgi_gettextheight"><p>
+
+<quote>
+<descrip>
+<tag/Function/Calculate the height of the text in pixels according to
+the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_gettextheight (const char* s);/
+<tag/Description/Calculate the height of the text in pixels according to
+the current text style.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>tgi_gettextwidth<label id="tgi_gettextwidth"><p>
+
+<quote>
+<descrip>
+<tag/Function/Calculate the width of the text in pixels according to the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_gettextwidth (const char* s);/
+<tag/Description/Calculate the width of the text in pixels according to the current text style.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>tgi_getxres<label id="tgi_getxres"><p>
 
 <quote>
@@ -827,6 +823,7 @@ tgi_bar(10,10,20,20);
 </descrip>
 </quote>
 
+
 <sect1>tgi_setdrawpage<label id="tgi_setdrawpage"><p>
 
 <quote>
@@ -856,6 +853,7 @@ tgi_setviewpage(0); // Show page 0
 </descrip>
 </quote>
 
+
 <sect1>tgi_setpalette<label id="tgi_setpalette"><p>
 
 <quote>
@@ -876,6 +874,7 @@ be used in presence of a prototype.
 </descrip>
 </quote>
 
+
 <sect1>tgi_setpixel<label id="tgi_setpixel"><p>
 
 <quote>
@@ -894,54 +893,6 @@ be used in presence of a prototype.
 </descrip>
 </quote>
 
-<sect1>tgi_setviewpage<label id="tgi_setviewpage"><p>
-
-<quote>
-<descrip>
-<tag/Function/Set page to be visible on screen.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_setviewpage (unsigned char page);/
-<tag/Description/If the drawpage and the viewpage are the same then all drawing
-is seen immediately as it is drawn. For double buffered games you can set the
-drawpage to a different page than the viewpage. This lets you draw the next
-screen in the background and when the screen is ready you display it.
-<tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/<verb>
-tgi_setdrawpage(1);
-tgi_outtextxy(10, 10, "Hello World");
-tgi_setviewpage(1); // Show page 1
-tgi_setdrawpage(0);
-tgi_outtextxy(10, 10, "Creating next frame");
-...
-tgi_setviewpage(0); // Show page 0
-</verb>
-</descrip>
-</quote>
-
-<sect1>tgi_gettextheight<label id="tgi_gettextheight"><p>
-
-<quote>
-<descrip>
-<tag/Function/Calculate the height of the text in pixels according to
-the current text style.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/unsigned __fastcall__ tgi_gettextheight (const char* s);/
-<tag/Description/Calculate the height of the text in pixels according to
-the current text style.
-<tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
 
 <sect1>tgi_settextscale<label id="tgi_settextscale"><p>
 
@@ -964,6 +915,7 @@ be used in presence of a prototype.
 </descrip>
 </quote>
 
+
 <sect1>tgi_settextstyle<label id="tgi_settextstyle"><p>
 
 <quote>
@@ -983,24 +935,37 @@ be used in presence of a prototype.
 </descrip>
 </quote>
 
-<sect1>tgi_gettextwidth<label id="tgi_gettextwidth"><p>
+
+<sect1>tgi_setviewpage<label id="tgi_setviewpage"><p>
 
 <quote>
 <descrip>
-<tag/Function/Calculate the width of the text in pixels according to the current text style.
+<tag/Function/Set page to be visible on screen.
 <tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/unsigned __fastcall__ tgi_gettextwidth (const char* s);/
-<tag/Description/Calculate the width of the text in pixels according to the current text style.
+<tag/Declaration/<tt/void __fastcall__ tgi_setviewpage (unsigned char page);/
+<tag/Description/If the drawpage and the viewpage are the same then all drawing
+is seen immediately as it is drawn. For double buffered games you can set the
+drawpage to a different page than the viewpage. This lets you draw the next
+screen in the background and when the screen is ready you display it.
 <tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/Other tgi functions.
-<tag/Example/None.
+<tag/Example/<verb>
+tgi_setdrawpage(1);
+tgi_outtextxy(10, 10, "Hello World");
+tgi_setviewpage(1); // Show page 1
+tgi_setdrawpage(0);
+tgi_outtextxy(10, 10, "Creating next frame");
+...
+tgi_setviewpage(0); // Show page 0
+</verb>
 </descrip>
 </quote>
 
+
 <sect1>tgi_uninstall<label id="tgi_uninstall"><p>
 
 <quote>
@@ -1017,6 +982,7 @@ Will call tgi_done if necessary.
 </descrip>
 </quote>
 
+
 <sect1>tgi_unload<label id="tgi_unload"><p>
 
 <quote>