58 virtual void drawArrays(GLenum mode, GLint first, GLsizei count) {
63 unsigned int pos=first;
64 for(GLsizei i = 2 ; i < count ; i += 3, pos += 3) {
65 this->operator()(pos, pos + 1, pos + 2);
69 case(GL_TRIANGLE_STRIP):
71 unsigned int pos = first;
72 for(GLsizei i = 2 ; i < count ; ++ i, ++ pos) {
73 if ((i%2)) this->operator()(pos, pos + 2, pos + 1);
74 else this->operator()(pos, pos + 1, pos + 2);
80 unsigned int pos = first;
81 for(GLsizei i = 3 ; i < count ; i += 4, pos += 4) {
82 this->operator()(pos,pos + 1, pos + 2);
83 this->operator()(pos,pos + 2, pos + 3);
89 unsigned int pos = first;
90 for(GLsizei i = 3 ; i < count ; i += 2, pos += 2) {
91 this->operator()(pos, pos + 1,pos + 2);
92 this->operator()(pos + 1,pos + 3,pos + 2);
97 case(GL_TRIANGLE_FAN):
99 unsigned int pos = first + 1;
100 for(GLsizei i = 2 ; i < count ; ++ i, ++ pos) {
101 this->operator()(first, pos, pos + 1);
107 unsigned int pos = first;
108 for(GLsizei i = 0 ; i < count ; i += 2, pos += 2) {
109 this->operator()(pos, pos + 1);
115 unsigned int pos = first;
116 for(GLsizei i = 0 ; i < count - 1 ; i += 1, pos += 1) {
117 this->operator()(pos, pos + 1);
123 unsigned int pos = first;
124 for(GLsizei i = 0 ; i < count - 1 ; i += 1, pos += 1) {
125 this->operator()(pos, pos + 1);
127 this->operator()(pos, first);
132 unsigned int pos=first;
133 for(GLsizei i = 0 ; i < count ; ++ i) {
134 this->operator()(pos + i);
147 typedef const I* IndexPointer;
149 if (indices == 0 || count == 0) {
157 IndexPointer ilast = &indices[count];
158 for(IndexPointer iptr = indices ; iptr < ilast ; iptr += 3) {
159 this->operator()(*iptr, *(iptr + 1), *(iptr + 2));
163 case(GL_TRIANGLE_STRIP):
165 IndexPointer iptr = indices;
166 for(GLsizei i = 2 ; i < count ; ++ i, ++ iptr) {
167 if ((i%2)) this->operator()(*(iptr), *(iptr + 2), *(iptr + 1));
168 else this->operator()(*(iptr), *(iptr + 1), *(iptr + 2));
174 IndexPointer iptr = indices;
175 for(GLsizei i = 3 ; i < count ; i += 4, iptr += 4) {
176 this->operator()(*(iptr), *(iptr + 1), *(iptr + 2));
177 this->operator()(*(iptr), *(iptr + 2), *(iptr + 3));
183 IndexPointer iptr = indices;
184 for(GLsizei i = 3 ; i < count ; i += 2, iptr += 2) {
185 this->operator()(*(iptr), *(iptr + 1), *(iptr + 2));
186 this->operator()(*(iptr + 1), *(iptr + 3), *(iptr + 2));
191 case(GL_TRIANGLE_FAN):
193 IndexPointer iptr = indices;
196 for(GLsizei i = 2 ; i < count ; ++ i, ++ iptr) {
197 this->operator()(first, *(iptr), *(iptr + 1));
203 const I* iptr = indices;
204 for(GLsizei i = 0 ; i < count ; i += 2, iptr += 2) {
205 this->operator()(*iptr, *(iptr + 1));
211 const I* iptr = indices;
212 for(GLsizei i = 0 ; i < count - 1 ; i += 1, iptr += 1) {
213 this->operator()(*iptr, *(iptr + 1));
219 const I* iptr = indices;
221 for(GLsizei i = 0 ; i < count - 1 ; i += 1, iptr += 1) {
222 this->operator()(*iptr, *(iptr + 1));
224 this->operator()(*iptr, first);
229 IndexPointer ilast = &indices[count];
230 for(IndexPointer iptr = indices ; iptr < ilast ; iptr += 1) {
231 this->operator()(*iptr);