Usermode/AxWin4 - Server implemenation moving along
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / main.cpp
index e14ef13..acea927 100644 (file)
@@ -1,4 +1,9 @@
 /*
+ * Acess2 GUI v4 (AxWin4)
+ * - By John Hodge (thePowesGang)
+ * 
+ * main.cpp
+ * - Program main
  */
 #include <CConfig.hpp>
 #include <ipc.hpp>
@@ -8,6 +13,7 @@
 #include <timing.hpp>
 #include <exception>
 #include <algorithm>
+#include <common.hpp>
 
 extern "C" {
 #include <stdio.h>
@@ -29,24 +35,24 @@ int main(int argc, char *argv[])
                return 1;
        }
        // - Open graphics
-       Graphics::Initialise(config.m_video);
+       CVideo* vid = new CVideo(config.m_video);
        // - Initialise compositor structures
-       CCompositor* compositor = new CCompositor(/*config.m_compositor*/);
+       CCompositor* compositor = new CCompositor(/*config.m_compositor,*/ *vid);
        // - Open input
-       Input::Initialise(config.m_input);
+       CInput* input = new CInput(config.m_input, *compositor);
        //  > Handles hotkeys?
        // - Bind IPC channels
-       IPC::Initialise(config.m_ipc, compositor);
+       IPC::Initialise(config.m_ipc, *compositor);
        // - Start root child process (from config)
        // TODO: Spin up child process
-
+       
        // - Event loop
        for( ;; )
        {
                 int    nfd = 0;
                fd_set  rfds;
                
-               nfd = ::std::max(nfd, Input::FillSelect(rfds));
+               nfd = ::std::max(nfd, input->FillSelect(rfds));
                nfd = ::std::max(nfd, IPC::FillSelect(rfds));
                
                // TODO: Support _SysSendMessage IPC?
@@ -55,7 +61,7 @@ int main(int argc, char *argv[])
                
                Timing::CheckEvents();
                
-               Input::HandleSelect(rfds);
+               input->HandleSelect(rfds);
                IPC::HandleSelect(rfds);
                
                compositor->Redraw();
@@ -63,3 +69,13 @@ int main(int argc, char *argv[])
        return 0;
 }
 
+namespace AxWin {
+
+const char* InitFailure::what() const throw()
+{
+       return m_what;
+}
+
+
+}
+

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