]> git.sur5r.net Git - cc65/blob - samples/geos/hello2.c
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / samples / geos / hello2.c
1 /*
2     GEOSLib example
3     
4     Hello, world example - using graphic functions
5     
6     Maciej 'YTM/Alliance' Witkowiak
7     <ytm@friko.onet.pl>
8     
9     26.12.1999
10 */
11
12
13 #include <geos.h>
14
15 // Let's define the window we're operating
16 struct window wholeScreen = {0, SC_PIX_HEIGHT-1, 0, SC_PIX_WIDTH-1};
17
18
19 void main (void)
20 {
21     // Let's show what we've got...
22
23     // Let's clear the screen - with different pattern, because apps have cleared screen upon
24     // start
25     SetPattern(0);
26     InitDrawWindow(&wholeScreen);
27     Rectangle();
28    
29     // Now some texts
30     PutString(COUTLINEON "This is compiled using cc65!" CPLAINTEXT, 20, 10);
31     PutString(CBOLDON "This is bold", 30, 10);
32     PutString(CULINEON "and this is bold and underline!", 40, 10);
33     PutString(CPLAINTEXT "This is plain text", 50, 10);
34     
35     // Wait for 5 secs...
36     // Note that this is multitasking sleep, and if there are any icons/menus onscreen,
37     // they would be usable, in this case you have only pointer usable
38     Sleep(5*50);
39              
40     // Normal apps exit from main into system's mainloop, and app finish
41     // when user selects it from icons or menu, but here we want to exit
42     // immediately.
43     // So instead:
44     //  MainLoop();
45     // we can do:
46     //  (nothing as this is the end of main function)
47     //  exit(0);
48     //  return;
49
50     return;
51 }