… | |
… | |
74 | colour c; // colour |
74 | colour c; // colour |
75 | point p; // vertex |
75 | point p; // vertex |
76 | }; |
76 | }; |
77 | |
77 | |
78 | struct vertex2d { |
78 | struct vertex2d { |
79 | colour c; // colour |
|
|
80 | point p; // vertex |
79 | point p; // vertex |
81 | vec3 n; // normal |
80 | vec3 n; // normal |
82 | texc t; // texture |
81 | texc t; // texture |
83 | |
82 | |
84 | vertex2d () { }; |
83 | vertex2d () { }; |
85 | vertex2d (colour c, point p, vec3 n, texc t = texc()) : c(c), p(p), n(n), t(t) { }; |
84 | vertex2d (point p, vec3 n, texc t = texc()) : p(p), n(n), t(t) { }; |
|
|
85 | }; |
|
|
86 | |
|
|
87 | struct entity_opengl : entity_base { |
86 | }; |
88 | }; |
87 | |
89 | |
88 | template<GLenum type> |
90 | template<GLenum type> |
89 | struct entity_opengl1d : entity_base, vector<vertex1d> { |
91 | struct entity_opengl1d : entity_opengl, vector<vertex1d> { |
90 | void update_bbox (); |
92 | void update_bbox (); |
91 | void show (const sector &sec); |
93 | void show (const sector &sec); |
92 | void draw (const draw_context &ctx); |
94 | void draw (const draw_context &ctx); |
93 | }; |
95 | }; |
94 | |
96 | |
95 | template<GLenum type> |
97 | template<GLenum type> |
96 | struct entity_opengl2d : entity_base, vector<vertex2d> { |
98 | struct entity_opengl2d : entity_opengl, vector<vertex2d> { |
|
|
99 | material m; |
|
|
100 | |
97 | void update_bbox (); |
101 | void update_bbox (); |
98 | void show (const sector &sec); |
102 | void show (const sector &sec); |
99 | void draw (const draw_context &ctx); |
103 | void draw (const draw_context &ctx); |
100 | }; |
104 | }; |
101 | |
105 | |