AxWin2 - Huge changes, getting to the working point
[tpg/acess2.git] / Usermode / Applications / axwin2_src / WM / main.c
1 /*
2  * Acess GUI (AxWin) Version 2
3  * By John Hodge (thePowersGang)
4  */
5 #include "common.h"
6 #include <acess/sys.h>
7
8 // === IMPORTS ===
9 extern void     WM_Update(void);
10
11 // === GLOBALS ===
12 const char      *gsTerminalDevice = NULL;
13 const char      *gsMouseDevice = NULL;
14
15  int    giScreenWidth = 640;
16  int    giScreenHeight = 480;
17 uint32_t        *gpScreenBuffer = NULL;
18
19  int    giTerminalFD = -1;
20  int    giMouseFD = -1;
21  
22
23 // === CODE ===
24 /**
25  * \brief Program Entrypoint
26  */
27 int main(int argc, char *argv[])
28 {
29         ParseCommandline(argc, argv);
30         
31         if( gsTerminalDevice == NULL ) {
32                 gsTerminalDevice = "/Devices/VTerm/6";
33         }
34         if( gsMouseDevice == NULL ) {
35                 gsMouseDevice = "/Devices/PS2Mouse";
36         }
37         
38         Video_Setup();
39         Interface_Init();
40         IPC_Init();
41         
42         WM_Update();
43         
44         // Main Loop
45         for(;;)
46         {
47                 fd_set  fds;
48                  int    nfds = 0;
49                 FD_ZERO(&fds);
50         
51                 Input_FillSelect(&nfds, &fds);
52                 IPC_FillSelect(&nfds, &fds);
53                 
54                 nfds ++;
55                 select(nfds, &fds, NULL, NULL, NULL);
56
57                 Input_HandleSelect(&fds);
58                 IPC_HandleSelect(&fds);
59         }
60         return 0;
61 }
62

UCC git Repository :: git.ucc.asn.au