… | |
… | |
104 | struct entity_affine : entity_filter { |
104 | struct entity_affine : entity_filter { |
105 | //matrix m; |
105 | //matrix m; |
106 | }; |
106 | }; |
107 | |
107 | |
108 | struct vertex1d { |
108 | struct vertex1d { |
109 | point v; // vertex |
109 | point p; // vertex |
110 | colour c; // colour |
110 | colour c; // colour |
111 | }; |
111 | }; |
112 | |
112 | |
113 | struct vertex2d { |
113 | struct vertex2d { |
114 | point v; // vertex |
114 | point p; // vertex |
115 | colour c; // colour |
115 | colour c; // colour |
116 | vect n; // normal |
116 | vect n; // normal |
117 | texc t; // texture |
117 | texc t; // texture |
118 | }; |
118 | }; |
119 | |
119 | |
… | |
… | |
131 | void draw (); |
131 | void draw (); |
132 | }; |
132 | }; |
133 | |
133 | |
134 | typedef entity_opengl1d<GL_POINTS> entity_points; |
134 | typedef entity_opengl1d<GL_POINTS> entity_points; |
135 | typedef entity_opengl1d<GL_LINES> entity_lines; |
135 | typedef entity_opengl1d<GL_LINES> entity_lines; |
136 | typedef entity_opengl1d<GL_LINE_STRIP> entity_linestrip; |
136 | typedef entity_opengl1d<GL_LINE_STRIP> entity_line_strip; |
137 | typedef entity_opengl1d<GL_LINE_LOOP> entity_lineloop; |
137 | typedef entity_opengl1d<GL_LINE_LOOP> entity_line_loop; |
138 | typedef entity_opengl2d<GL_TRIANGLES> entity_triangles; |
138 | typedef entity_opengl2d<GL_TRIANGLES> entity_triangles; |
139 | typedef entity_opengl2d<GL_TRIANGLE_STRIP> entity_trianglestrip; |
139 | typedef entity_opengl2d<GL_TRIANGLE_STRIP> entity_triangle_strip; |
140 | typedef entity_opengl2d<GL_TRIANGLE_FAN> entity_trianglefan; |
140 | typedef entity_opengl2d<GL_TRIANGLE_FAN> entity_triangle_fan; |
141 | typedef entity_opengl2d<GL_QUADS> entity_quads; |
141 | typedef entity_opengl2d<GL_QUADS> entity_quads; |
142 | typedef entity_opengl2d<GL_QUAD_STRIP> entity_quad_strip; |
142 | typedef entity_opengl2d<GL_QUAD_STRIP> entity_quad_strip; |
143 | typedef entity_opengl2d<GL_POLYGON> entity_polygon; |
143 | typedef entity_opengl2d<GL_POLYGON> entity_polygon; |
|
|
144 | |
|
|
145 | struct light { |
|
|
146 | point p; |
|
|
147 | colour c; |
|
|
148 | GLfloat intensity; |
|
|
149 | GLfloat radius; |
|
|
150 | }; |
|
|
151 | |
|
|
152 | struct draw_context { |
|
|
153 | enum { DEPTH, AMBIENT, LIGHTED } mode; |
|
|
154 | light *l; |
|
|
155 | }; |
|
|
156 | |
|
|
157 | struct view { |
|
|
158 | point p; |
|
|
159 | vect d; |
|
|
160 | float fov; |
|
|
161 | |
|
|
162 | int width, height; |
|
|
163 | |
|
|
164 | void draw (const draw_context &c); |
|
|
165 | }; |
144 | |
166 | |
145 | #endif |
167 | #endif |
146 | |
168 | |
147 | |
169 | |
148 | |
170 | |