projects
/
universe.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update.
[universe.git]
/
universe.h
diff --git
a/universe.h
b/universe.h
index
77980b8
..
a48a3ba
100644
(file)
--- a/
universe.h
+++ b/
universe.h
@@
-8,30
+8,30
@@
#include <iostream>
#include <cmath>
#include <iostream>
#include <cmath>
-#ifdef CAIRO_SUPPORT
-#include <cairo.h>
+#include "misc.h"
+#include "canvas.h"
+#include "polygon.h"
+
+#ifdef X11_SUPPORT
+#include "simple_window.h"
#endif
using namespace std;
#endif
using namespace std;
-#include "misc.h"
-#include "simple_window.h"
-#include "polygon.h"
-
class Universe {
class Universe {
- scalar_t _
xmax, _ymax
;
+ scalar_t _
width, _height
;
public:
int _nb_max_polygons, _nb_polygons;
Polygon **_polygons;
public:
int _nb_max_polygons, _nb_polygons;
Polygon **_polygons;
- inline scalar_t width() { return _
xmax
; }
- inline scalar_t height() { return _
ymax
; }
+ inline scalar_t width() { return _
width
; }
+ inline scalar_t height() { return _
height
; }
- Universe(int nb_max_polygons, scalar_t
xmax, scalar_t ymax
);
+ Universe(int nb_max_polygons, scalar_t
width, scalar_t height
);
// The destructor deletes all the added polygons
~Universe();
// The destructor deletes all the added polygons
~Universe();
- void initialize(Polygon *p);
+ void initialize
_polygon
(Polygon *p);
void clear();
void add_polygon(Polygon *p);
bool collide(Polygon *p);
void clear();
void add_polygon(Polygon *p);
bool collide(Polygon *p);
@@
-44,12
+44,15
@@
public:
Polygon *pick_polygon(scalar_t x, scalar_t y);
Polygon *pick_polygon(scalar_t x, scalar_t y);
+#ifdef XFIG_SUPPORT
void print_xfig(XFigTracer *tracer);
void print_xfig(XFigTracer *tracer);
- void draw(SimpleWindow *window);
+#endif
-#ifdef
CAIRO
_SUPPORT
- void draw(
cairo_t *context_resource
);
+#ifdef
X11
_SUPPORT
+ void draw(
SimpleWindow *window
);
#endif
#endif
+
+ void draw(Canvas *canvas);
};
#endif
};
#endif