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

Comparing libgender/entity.h (file contents):
Revision 1.12 by root, Sun Oct 3 23:59:30 2004 UTC vs.
Revision 1.13 by root, Mon Oct 4 02:06:57 2004 UTC

76 vertex2d () { }; 76 vertex2d () { };
77 vertex2d (point p, vec3 n, texc t = texc()) : p(p), n(n), t(t) { }; 77 vertex2d (point p, vec3 n, texc t = texc()) : p(p), n(n), t(t) { };
78}; 78};
79 79
80struct entity_opengl : entity_base { 80struct entity_opengl : entity_base {
81 GLuint list;
82
83 entity_opengl ();
84 ~entity_opengl ();
81}; 85};
82 86
83template<GLenum type> 87template<GLenum type>
84struct entity_opengl1d : entity_opengl, vector<vertex1d> { 88struct entity_opengl1d : entity_opengl, vector<vertex1d> {
85 void update_bbox (); 89 void update_bbox ();
86 void draw (draw_context &ctx); 90 void draw (draw_context &ctx);
87}; 91};
88 92
89template<GLenum type> 93template<GLenum type>
90struct entity_opengl2d : entity_opengl, vector<vertex2d> { 94struct entity_opengl2d : entity_opengl {
91 material m; 95 material m;
92 GLuint list;
93 96
94 void update_bbox (); 97 void set (const vector<vertex2d> &v);
95 void draw (draw_context &ctx); 98 void draw (draw_context &ctx);
96 99
97 entity_opengl2d ()
98 : list(0)
99 {
100 }
101
102 ~entity_opengl2d ()
103 {
104 if (list)
105 glDeleteLists (list, 1);
106 }
107}; 100};
108 101
109typedef entity_opengl1d<GL_POINTS> entity_points; 102typedef entity_opengl1d<GL_POINTS> entity_points;
110typedef entity_opengl1d<GL_LINES> entity_lines; 103typedef entity_opengl1d<GL_LINES> entity_lines;
111typedef entity_opengl1d<GL_LINE_STRIP> entity_line_strip; 104typedef entity_opengl1d<GL_LINE_STRIP> entity_line_strip;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines