/** @return the maximum number of indices this mesh can hold */ public int getMaxIndices () { return indices.getNumMaxIndices(); }
/** @return the maximum number of indices this mesh can hold */ public int getMaxIndices () { return indices.getNumMaxIndices(); }
/** <p> * Renders the mesh using the given primitive type. If indices are set for this mesh then getNumIndices() / #vertices per * primitive primitives are rendered. If no indices are set then getNumVertices() / #vertices per primitive are rendered. * </p> * * <p> * This method will automatically bind each vertex attribute as specified at construction time via {@link VertexAttributes} to * the respective shader attributes. The binding is based on the alias defined for each VertexAttribute. * </p> * * <p> * This method must only be called after the {@link ShaderProgram#begin()} method has been called! * </p> * * <p> * This method is intended for use with OpenGL ES 2.0 and will throw an IllegalStateException when OpenGL ES 1.x is used. * </p> * * @param primitiveType the primitive type */ public void render (ShaderProgram shader, int primitiveType) { render(shader, primitiveType, 0, indices.getNumMaxIndices() > 0 ? getNumIndices() : getNumVertices(), autoBind); }
/** <p> * Renders the mesh using the given primitive type. If indices are set for this mesh then getNumIndices() / #vertices per * primitive primitives are rendered. If no indices are set then getNumVertices() / #vertices per primitive are rendered. * </p> * * <p> * This method will automatically bind each vertex attribute as specified at construction time via {@link VertexAttributes} to * the respective shader attributes. The binding is based on the alias defined for each VertexAttribute. * </p> * * <p> * This method must only be called after the {@link ShaderProgram#begin()} method has been called! * </p> * * <p> * This method is intended for use with OpenGL ES 2.0 and will throw an IllegalStateException when OpenGL ES 1.x is used. * </p> * * @param primitiveType the primitive type */ public void render (ShaderProgram shader, int primitiveType) { render(shader, primitiveType, 0, indices.getNumMaxIndices() > 0 ? getNumIndices() : getNumVertices(), autoBind); }
if (count + offset > indices.getNumMaxIndices()) { throw new GdxRuntimeException("Mesh attempting to access memory outside of the index buffer (count: " + count + ", offset: " + offset + ", max: " + indices.getNumMaxIndices() + ")");
if (count + offset > indices.getNumMaxIndices()) { throw new GdxRuntimeException("Mesh attempting to access memory outside of the index buffer (count: " + count + ", offset: " + offset + ", max: " + indices.getNumMaxIndices() + ")");
/** @return the maximum number of indices this mesh can hold */ public int getMaxIndices () { return indices.getNumMaxIndices(); }
/** <p> * Renders the mesh using the given primitive type. If indices are set for this mesh then getNumIndices() / #vertices per * primitive primitives are rendered. If no indices are set then getNumVertices() / #vertices per primitive are rendered. * </p> * * <p> * This method will automatically bind each vertex attribute as specified at construction time via {@link VertexAttributes} to * the respective shader attributes. The binding is based on the alias defined for each VertexAttribute. * </p> * * <p> * This method must only be called after the {@link ShaderProgram#begin()} method has been called! * </p> * * <p> * This method is intended for use with OpenGL ES 2.0 and will throw an IllegalStateException when OpenGL ES 1.x is used. * </p> * * @param primitiveType the primitive type */ public void render (ShaderProgram shader, int primitiveType) { render(shader, primitiveType, 0, indices.getNumMaxIndices() > 0 ? getNumIndices() : getNumVertices(), autoBind); }
if (count + offset > indices.getNumMaxIndices()) { throw new GdxRuntimeException("Mesh attempting to access memory outside of the index buffer (count: " + count + ", offset: " + offset + ", max: " + indices.getNumMaxIndices() + ")");