--- libgender/entity.h 2004/10/03 03:19:56 1.7 +++ libgender/entity.h 2004/10/03 05:10:45 1.8 @@ -7,6 +7,7 @@ #include "util.h" #include "oct.h" +#include "view.h" using namespace std; @@ -18,7 +19,8 @@ virtual void update_bbox (); virtual void show (const sector &sec) { }; void hide (); - virtual void draw (const draw_context &ctx) = 0; + virtual void draw (draw_context &ctx) = 0; + void try_draw (draw_context &ctx) { if (ctx.may_draw (this)) draw (ctx); } virtual ~entity_base () { hide (); @@ -29,7 +31,7 @@ void add (entity_base *e) { push_back (e); e->parent = this; } void update_bbox (); void show (const sector &sec); - void draw (const draw_context &ctx); + void draw (draw_context &ctx); ~entity_container (); }; @@ -54,7 +56,7 @@ void update_bbox (); void show (const sector &sec); - void draw (const draw_context &ctx); + void draw (draw_context &ctx); ~entity_filter (); }; @@ -63,14 +65,14 @@ void show (const sector &sec); void show (); - void draw (const draw_context &ctx); + void draw (draw_context &ctx); }; #if 0 struct entity_affine : entity_filter { GLfloat m[4][4]; - void draw (const draw_context &ctx); + void draw (draw_context &ctx); }; #endif @@ -95,7 +97,7 @@ struct entity_opengl1d : entity_opengl, vector { void update_bbox (); void show (const sector &sec); - void draw (const draw_context &ctx); + void draw (draw_context &ctx); }; template @@ -104,7 +106,7 @@ void update_bbox (); void show (const sector &sec); - void draw (const draw_context &ctx); + void draw (draw_context &ctx); }; typedef entity_opengl1d entity_points; @@ -118,15 +120,6 @@ typedef entity_opengl2d entity_quad_strip; typedef entity_opengl2d entity_polygon; -struct view { - point p; - vec3 d, u; - float fov; - int w, h; - - void draw (const draw_context &ctx); -}; - #endif