ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/entity.h
(Generate patch)

Comparing libgender/entity.h (file contents):
Revision 1.13 by root, Mon Oct 4 02:06:57 2004 UTC vs.
Revision 1.15 by root, Mon Oct 4 07:04:58 2004 UTC

26 entity_base (); 26 entity_base ();
27 virtual ~entity_base (); 27 virtual ~entity_base ();
28}; 28};
29 29
30struct entity_container : entity_base, protected vector<entity_base *> { 30struct entity_container : entity_base, protected vector<entity_base *> {
31 void add (entity_base *e) { push_back (e); e->parent = this; } 31 void add (entity_base *e)
32 {
33 push_back (e);
34 e->parent = this;
35 update_bbox ();
36 }
37
32 void update_bbox (); 38 void update_bbox ();
33 void show (); 39 void show ();
34 void draw (draw_context &ctx); 40 void draw (draw_context &ctx);
35 ~entity_container (); 41 ~entity_container ();
36}; 42};
42 48
43 void set (entity_base *e) 49 void set (entity_base *e)
44 { 50 {
45 this->e = e; 51 this->e = e;
46 e->parent = this; 52 e->parent = this;
53 update_bbox ();
47 } 54 }
48 55
49 void remove () 56 void remove ()
50 { 57 {
51 this->e->parent = 0; 58 this->e->parent = 0;
94struct entity_opengl2d : entity_opengl { 101struct entity_opengl2d : entity_opengl {
95 material m; 102 material m;
96 103
97 void set (const vector<vertex2d> &v); 104 void set (const vector<vertex2d> &v);
98 void draw (draw_context &ctx); 105 void draw (draw_context &ctx);
99
100}; 106};
101 107
102typedef entity_opengl1d<GL_POINTS> entity_points; 108typedef entity_opengl1d<GL_POINTS> entity_points;
103typedef entity_opengl1d<GL_LINES> entity_lines; 109typedef entity_opengl1d<GL_LINES> entity_lines;
104typedef entity_opengl1d<GL_LINE_STRIP> entity_line_strip; 110typedef entity_opengl1d<GL_LINE_STRIP> entity_line_strip;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines