X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=1b2073e8ac16032c13c1c2b674cd6da682852985;hp=273d82a5bd0901ca32c4c044bf55b0c86b7a9764;hb=95dd47f77239fd252e0292dca21baac29513bc7b;hpb=245ccc8576d4bd29ab04d506ddb0c44b04a67e39 diff --git a/src/main.cpp b/src/main.cpp index 273d82a..1b2073e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,26 +1,23 @@ -#include "common.h" - -#include "document.h" -#include "view.h" -#include "screen.h" - -using namespace std; -using namespace IPDF; - +#include "main.h" +#include // Because we can. int main(int argc, char ** argv) -{ +{ Document doc; - doc.Add(0.5, 0.5, 0.5, 0.5); - - View view(doc); - - Screen scr; - - while (scr.PumpEvents()) + srand(time(NULL)); + if (argc > 1) { - view.Render(); - scr.Present(); + for (int i = 2; i < argc; ++i) + { + if (fork() == 0) doc.Load(argv[i]); + } + doc.Load(argv[1]); } - + else + { + Debug("Add random object"); + //doc.Add(RECT_FILLED, Rect(Random()*0.5, Random()*0.5, Random()*0.5, Random()*0.5)); + doc.Add(RECT_FILLED, Rect(0.25,0.25, 0.5, 0.5)); + } + MainLoop(doc); return 0; }