git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make real.h so we can change reals
[ipdf/code.git]
/
src
/
main.cpp
diff --git
a/src/main.cpp
b/src/main.cpp
index
5fa94b7
..
339ea8d
100644
(file)
--- a/
src/main.cpp
+++ b/
src/main.cpp
@@
-1,27
+1,22
@@
-#include "common.h"
-
-#include "document.h"
-#include "view.h"
-#include "screen.h"
-
-using namespace std;
-using namespace IPDF;
-
+#include "main.h"
+#include <unistd.h> // Because we can.
int main(int argc, char ** argv)
int main(int argc, char ** argv)
-{
+{
Document doc;
srand(time(NULL));
Document doc;
srand(time(NULL));
- doc.Add(Random(), Random(), Random(), Random());
-
- View view(doc);
-
- Screen scr;
-
- while (scr.PumpEvents())
+ 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));
+ }
+ MainLoop(doc);
return 0;
}
return 0;
}
UCC
git Repository :: git.ucc.asn.au