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

Comparing libgender/view.h (file contents):
Revision 1.27 by root, Mon Oct 18 12:01:14 2004 UTC vs.
Revision 1.31 by root, Tue Nov 2 23:26:46 2004 UTC

30 occ_query (view &ctx, void *id, GLuint count) : ctx(ctx), id(id), count(count) { }; 30 occ_query (view &ctx, void *id, GLuint count) : ctx(ctx), id(id), count(count) { };
31}; 31};
32 32
33typedef event_receiver<void, occ_query> recv_occ_query; 33typedef event_receiver<void, occ_query> recv_occ_query;
34 34
35struct pass
36{
37 struct light *l;
38
39 pass (light *l) : l(l) { }
40};
41
42extern pass pass_depth;
43
35struct view 44struct view
36{ 45{
37 sector orig; 46 sector orig;
38 point p; 47 point p;
39 vec3 d, u; 48 vec3 d, u;
40 GLfloat fov; 49 GLfloat fov;
41 GLfloat z_near, z_far, c_far; 50 GLfloat z_near, z_far, c_far;
42 int w, h; 51 int w, h;
43 GLfloat pixfact; // how many pixels on screen are drawn by a unit length line, *roughly* 52 GLfloat pixfact; // how many pixels on screen are drawn by a unit length line, *roughly*
53 sector eorig; // orig of currently-rendered entity in relation to the camera
44 54
45 GLfloat gamma; 55 GLfloat gamma;
46 56
47 // only to be used by friends: TODO 57 // only to be used by friends: TODO
48 58
49 GLfloat nz_far, nc_far; 59 GLfloat nz_far, nz_near, nc_far;
50 GLfloat diagfact; // bounding box border to depth factor 60 GLfloat diagfact; // bounding box border to depth factor
51 GLfloat perspfact; // perspfact * (1/depth)=> pixels 61 GLfloat perspfact; // perspfact * (1/depth)=> pixels
52 62
53 gl::matrix projection; 63 gl::matrix projection;
54 64
57 cone c; 67 cone c;
58 sphere s; 68 sphere s;
59 } frustum; 69 } frustum;
60 70
61 // the passes 71 // the passes
62 enum pass { 72 enum pass_type {
63 DEPTH, // mandatory, render depth only 73 DEPTH, // mandatory, render depth only
64 POSTDEPTH, // mandatory, occ tests or ignored 74 POSTDEPTH, // mandatory, occ tests or ignored
65 LIGHTED, // optional, render faces in full glory 75 LIGHTED, // optional, render faces in full glory
66 } pass; 76 } pass_type;
67 77
68 struct light *l; 78 pass *pass_data;
79
69 set<const entity *> drawn; // TODO: put drawn info and octant+entity visibility info into vismap! 80 set<const entity *> drawn; // TODO: put drawn info and octant+entity visibility info into vismap!
70 81
71 unsigned int generation; 82 unsigned int generation;
72 typedef map<visible *, visibility_base *> visibility_map; 83 typedef map<visible *, visibility_base *> visibility_map;
73 visibility_map vismap; 84 visibility_map vismap;
88 void reset_projection (); 99 void reset_projection ();
89 100
90 // public 101 // public
91 102
92 void begin (); 103 void begin ();
93 void render (enum pass p); 104 void render (enum pass_type p, pass &data);
94 void end (); 105 void end ();
95 106
96 bool may_draw (const entity *e); 107 bool may_draw (const entity *e);
97 108
98 view (); 109 view ();
99 ~view (); 110 ~view ();
100}; 111};
101 112
113struct light : view
114{
115 colour c;
116 GLfloat intensity;
117 GLfloat radius;
118};
119
102#endif 120#endif
103 121

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines