Вообще если есть возможность, то лучше сделать сразу несколькими путями:
Код:
int CMD2_OGL:: draw ()
{
if ( yes_init_md2 == false || yes_draw_model == false)
return IS_ERROR;
CTexture_OGL * tex;
ulong_t off=0;
tex = (CTexture_OGL *) skin_ptr->tex_skin;
tex->bind_texture();
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
if ( yes_buffers_ogl && scene_setting!=0 && scene_setting->yes_buffer_ogl ) {
glBindBuffer(GL_ARRAY_BUFFER, bufferID);
glVertexPointer(3, GL_FLOAT, 0, (GLvoid*)off);
off+=(sizeof(SVector3f) * count_tri * 3);
glTexCoordPointer(2, GL_FLOAT, 0, (GLvoid*)off);
}
else {
glVertexPointer(3, GL_FLOAT, 0, (GLvoid*)ptr_vertexs);
glTexCoordPointer(2, GL_FLOAT, 0, (GLvoid*)tex_coords);
}
glDrawArrays(GL_TRIANGLES, 0, count_tri * 3);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
if ( yes_buffers_ogl && scene_setting!=0 && scene_setting->yes_buffer_ogl )
glBindBuffer(GL_ARRAY_BUFFER, 0);
/*
glBegin(GL_TRIANGLES);
for(ulong_t x = 0, k=0; x < count_tri; x++)
{
glTexCoord2fv( (GLfloat*)&tex_coords[k] );
glVertex3fv( (GLfloat*)&ptr_vertexs[k++] );
glTexCoord2fv( (GLfloat*)&tex_coords[k] );
glVertex3fv( (GLfloat*)&ptr_vertexs[k++] );
glTexCoord2fv( (GLfloat*)&tex_coords[k] );
glVertex3fv( (GLfloat*)&ptr_vertexs[k++] );
}
glEnd();
*/
return IS_OK;
}