MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / DrawMesh

Function DrawMesh

demo/opengl/shadersGL.cpp:864–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862}
863
864void 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
896void 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{

Callers 5

RenderEllipsoidsFunction · 0.70
RenderSceneFunction · 0.50
DrawShapesFunction · 0.50
DrawMethod · 0.50
DrawMethod · 0.50

Calls 2

sizeMethod · 0.80
GetNumFacesMethod · 0.45

Tested by

no test coverage detected