public void drawTriangleArray(Mesh.Mode mode, int count, int vertCount) { if (count > 1) { ARBDrawInstanced.glDrawArraysInstancedARB(convertElementMode(mode), 0, vertCount, count); } else { glDrawArrays(convertElementMode(mode), 0, vertCount); } }
public static void glDrawArraysInstanced(int mode, int first, int count, int primcount) { if(GL_VERSION >= 31) { GL31.glDrawArraysInstanced(mode, first, count, primcount); } else if(GLContext.getCapabilities().GL_ARB_draw_instanced) { ARBDrawInstanced.glDrawArraysInstancedARB(mode, first, count, primcount); } else { throw new UnsupportedOperationException("GL_ARB_draw_instanced not supported on this system."); } }
public static void glDrawElementsInstanced(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) { if(GL_VERSION >= 31) { GL31.glDrawElementsInstanced(mode, indices_count, type, indices_buffer_offset, primcount); } else if(GLContext.getCapabilities().GL_ARB_draw_instanced) { ARBDrawInstanced.glDrawElementsInstancedARB(mode, indices_count, type, indices_buffer_offset, primcount); } else { throw new UnsupportedOperationException("GL_ARB_draw_instanced not supported on this system."); } }
@Override public void glDrawArraysInstanced(int mode, int first, int count, int primcount) { ARBDrawInstanced.glDrawArraysInstancedARB(mode, first, count, primcount); }