public void BindBuffers(OpenGLScene scene) { glBindBuffer(GL_ARRAY_BUFFER, vpb); glVertexAttribPointer(scene.vpa, 3, GL_FLOAT, GL_FALSE, 0); for (int m = 0; m < maps.Size(); m++) { maps.Get(m).BindBuffers(scene); } glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vib); }
public void Render(OpenGLScene scene) { if (vpl.Size() == 0 || vil.Size() == 0) { return; //crashes if empty ??? } int uvcnt = maps.Size(); glUniform1i(scene.uUVMaps, uvcnt); glEnableVertexAttribArray(scene.tca[0]); if (uvcnt > 1) { glEnableVertexAttribArray(scene.tca[1]); } else { glDisableVertexAttribArray(scene.tca[1]); } glDrawElements(type, vil.Size(), GL_UNSIGNED_INT); }
public void BindBuffers(OpenGLScene scene) { glBindBuffer(GL_ARRAY_BUFFER, uvb); glVertexAttribPointer(scene.tca[mapIndex], 2, GL_FLOAT, GL_FALSE, 0); }