--- libgender/view.h 2004/10/18 12:01:14 1.27 +++ libgender/view.h 2004/11/02 23:26:46 1.31 @@ -32,6 +32,15 @@ typedef event_receiver recv_occ_query; +struct pass +{ + struct light *l; + + pass (light *l) : l(l) { } +}; + +extern pass pass_depth; + struct view { sector orig; @@ -41,12 +50,13 @@ GLfloat z_near, z_far, c_far; int w, h; GLfloat pixfact; // how many pixels on screen are drawn by a unit length line, *roughly* + sector eorig; // orig of currently-rendered entity in relation to the camera GLfloat gamma; // only to be used by friends: TODO - GLfloat nz_far, nc_far; + GLfloat nz_far, nz_near, nc_far; GLfloat diagfact; // bounding box border to depth factor GLfloat perspfact; // perspfact * (1/depth)=> pixels @@ -59,13 +69,14 @@ } frustum; // the passes - enum pass { + enum pass_type { DEPTH, // mandatory, render depth only POSTDEPTH, // mandatory, occ tests or ignored LIGHTED, // optional, render faces in full glory - } pass; + } pass_type; + + pass *pass_data; - struct light *l; set drawn; // TODO: put drawn info and octant+entity visibility info into vismap! unsigned int generation; @@ -90,7 +101,7 @@ // public void begin (); - void render (enum pass p); + void render (enum pass_type p, pass &data); void end (); bool may_draw (const entity *e); @@ -99,5 +110,12 @@ ~view (); }; +struct light : view +{ + colour c; + GLfloat intensity; + GLfloat radius; +}; + #endif