… | |
… | |
101 | }; |
101 | }; |
102 | |
102 | |
103 | template<GLenum type> |
103 | template<GLenum type> |
104 | struct entity_opengl2d : entity_opengl, vector<vertex2d> { |
104 | struct entity_opengl2d : entity_opengl, vector<vertex2d> { |
105 | material m; |
105 | material m; |
|
|
106 | GLuint list; |
106 | |
107 | |
107 | void update_bbox (); |
108 | void update_bbox (); |
108 | void show (const sector &sec); |
109 | void show (const sector &sec); |
109 | void draw (draw_context &ctx); |
110 | void draw (draw_context &ctx); |
|
|
111 | |
|
|
112 | entity_opengl2d () |
|
|
113 | : list(0) |
|
|
114 | { |
|
|
115 | } |
|
|
116 | |
|
|
117 | ~entity_opengl2d () |
|
|
118 | { |
|
|
119 | if (list) |
|
|
120 | glDeleteLists (list, 1); |
|
|
121 | } |
110 | }; |
122 | }; |
111 | |
123 | |
112 | typedef entity_opengl1d<GL_POINTS> entity_points; |
124 | typedef entity_opengl1d<GL_POINTS> entity_points; |
113 | typedef entity_opengl1d<GL_LINES> entity_lines; |
125 | typedef entity_opengl1d<GL_LINES> entity_lines; |
114 | typedef entity_opengl1d<GL_LINE_STRIP> entity_line_strip; |
126 | typedef entity_opengl1d<GL_LINE_STRIP> entity_line_strip; |