| 862 | } |
| 863 | |
| 864 | void DrawMesh(const Mesh* m, Vec3 color) |
| 865 | { |
| 866 | if (m) |
| 867 | { |
| 868 | glVerify(glColor3fv(color)); |
| 869 | glVerify(glSecondaryColor3fv(color)); |
| 870 | |
| 871 | glVerify(glBindBuffer(GL_ARRAY_BUFFER, 0)); |
| 872 | glVerify(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); |
| 873 | |
| 874 | glVerify(glEnableClientState(GL_NORMAL_ARRAY)); |
| 875 | glVerify(glEnableClientState(GL_VERTEX_ARRAY)); |
| 876 | |
| 877 | glVerify(glNormalPointer(GL_FLOAT, sizeof(float) * 3, &m->m_normals[0])); |
| 878 | glVerify(glVertexPointer(3, GL_FLOAT, sizeof(float) * 3, &m->m_positions[0])); |
| 879 | |
| 880 | if (m->m_colours.size()) |
| 881 | { |
| 882 | glVerify(glEnableClientState(GL_COLOR_ARRAY)); |
| 883 | glVerify(glColorPointer(4, GL_FLOAT, 0, &m->m_colours[0])); |
| 884 | } |
| 885 | |
| 886 | glVerify(glDrawElements(GL_TRIANGLES, m->GetNumFaces() * 3, GL_UNSIGNED_INT, &m->m_indices[0])); |
| 887 | |
| 888 | glVerify(glDisableClientState(GL_VERTEX_ARRAY)); |
| 889 | glVerify(glDisableClientState(GL_NORMAL_ARRAY)); |
| 890 | |
| 891 | if (m->m_colours.size()) |
| 892 | glVerify(glDisableClientState(GL_COLOR_ARRAY)); |
| 893 | } |
| 894 | } |
| 895 | |
| 896 | void DrawCloth(const Vec4* positions, const Vec4* normals, const float* uvs, const int* indices, int numTris, int numPositions, int colorIndex, float expand, bool twosided, bool smooth) |
| 897 | { |
no test coverage detected