Example usage for org.lwjgl.opengl GL20 glDisableVertexAttribArray

List of usage examples for org.lwjgl.opengl GL20 glDisableVertexAttribArray

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL20 glDisableVertexAttribArray.

Prototype

public static void glDisableVertexAttribArray(@NativeType("GLuint") int index) 

Source Link

Document

Disables a generic vertex attribute array.

Usage

From source file:org.spout.engine.renderer.GL30BatchVertexRenderer.java

License:Open Source License

/**
 * Draws this batch//  w  ww  . j av a2s.  c  o  m
 */
@Override
public void doRender(RenderMaterial material, int startVert, int endVert) {

    GL30.glBindVertexArray(vao);

    material.assign();

    for (VertexBufferImpl vb : vertexBuffers.valueCollection()) {
        vb.bind();
        GL20.glEnableVertexAttribArray(vb.getLayout());
        GL20.glVertexAttribPointer(vb.getLayout(), vb.getElements(), GL11.GL_FLOAT, false, 0, 0);
        //activeMaterial.getShader().enableAttribute(vb.getName(), vb.getElements(), GL11.GL_FLOAT, 0, 0, vb.getLayout());         
    }

    GL11.glDrawArrays(renderMode, startVert, endVert);

    for (VertexBufferImpl vb : vertexBuffers.valueCollection()) {
        GL20.glDisableVertexAttribArray(vb.getLayout());
    }

}

From source file:org.spout.engine.renderer.GL40BatchVertexRenderer.java

License:Open Source License

@Override
protected boolean doFlush(boolean force) {
    if (flushingBuffer.flush(force)) {
        GL30.glBindVertexArray(vao);//from  w  ww  .  ja va 2  s  .  c  om
        SpoutRenderer.checkGLError();

        if (currentBuffer != null) {
            currentBuffer.unbind();
            for (int layout : currentBuffer.getLayout()) {
                GL20.glDisableVertexAttribArray(layout);
                SpoutRenderer.checkGLError();
            }
        }

        flushingBuffer.bind(true);

        for (int layout : flushingBuffer.getLayout()) {
            GL20.glEnableVertexAttribArray(layout);
            SpoutRenderer.checkGLError();
        }

        GL30.glBindVertexArray(0);
        SpoutRenderer.checkGLError();
        return true;
    }
    return false;
}

From source file:ovh.tgrhavoc.gameengine.core.Mesh.java

License:Open Source License

public void draw() {
    GL20.glEnableVertexAttribArray(0);/*from  w  w  w.  ja v  a 2  s.  c  o m*/
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);

    GL20.glVertexAttribPointer(0, 3, GL11.GL_FLOAT, false, Vertex.SIZE * 4, 0);

    GL20.glVertexAttribPointer(1, 2, GL11.GL_FLOAT, false, Vertex.SIZE * 4, 12);

    GL20.glVertexAttribPointer(2, 3, GL11.GL_FLOAT, false, Vertex.SIZE * 4, 20);

    GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, ibo);

    GL11.glDrawElements(GL11.GL_TRIANGLES, size, GL11.GL_UNSIGNED_INT, 0);

    GL20.glDisableVertexAttribArray(0);
    GL20.glDisableVertexAttribArray(1);
    GL20.glDisableVertexAttribArray(2);
}

From source file:playn.java.JavaGL20.java

License:Apache License

@Override
public void glDisableVertexAttribArray(int index) {
    GL20.glDisableVertexAttribArray(index);
}

From source file:processing.lwjgl.PGL.java

License:Open Source License

public void disableVertexAttribArray(int loc) {
    GL20.glDisableVertexAttribArray(loc);
}

From source file:processing.opengl.PLWJGL.java

License:Open Source License

@Override
public void disableVertexAttribArray(int index) {
    GL20.glDisableVertexAttribArray(index);
}

From source file:render.Quad.java

public void quadLoop() {
    GL.glClear(GL.GL_COLOR_BUFFER_BIT);//from  www. j a va  2  s .  c  o m

    GL.glUseProgram(programId);

    GL.glBindVertexArray(vaoId);
    GL.glEnableVertexAttribArray(0);
    GL.glEnableVertexAttribArray(1);

    GL.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, vbindexId);
    GL.glDrawElements(GL.GL_TRIANGLES, indexCnt, GL.GL_UNSIGNED_INT, 0);

    GL.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
    GL20.glDisableVertexAttribArray(0);
    GL20.glDisableVertexAttribArray(1);
    GL.glBindVertexArray(0);
    GL.glUseProgram(0);

}

From source file:se.angergard.engine.graphics.Mesh.java

License:Apache License

public void draw() {
    GL20.glEnableVertexAttribArray(0);//from w  ww .  ja v  a  2s . co  m
    GL20.glEnableVertexAttribArray(1);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
    GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, ibo);

    GL20.glVertexAttribPointer(0, 2, GL11.GL_FLOAT, false, Vertex2D.SIZE_BYTES, 0);
    GL20.glVertexAttribPointer(1, 2, GL11.GL_FLOAT, false, Vertex2D.SIZE_BYTES, 8);
    GL11.glDrawElements(GL11.GL_TRIANGLES, INDICES_LENGTH, GL11.GL_UNSIGNED_INT, 0);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
    GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);

    GL20.glDisableVertexAttribArray(0);
    GL20.glDisableVertexAttribArray(1);
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glDisableVertexAttribArray(int a) {
    GL20.glDisableVertexAttribArray(a);
}

From source file:uk.co.ifs_studios.engine.geometry.BasicDrawElement.java

License:Open Source License

/**
 * Render DrawElement./*w w w. jav a  2s  . c  om*/
 */
public void render() {
    this.shader.getShaderProgram().use();

    Engine.getInstance().getWindow().getProjectionMatrix().store(this.matrixBuffer);
    this.matrixBuffer.flip();
    GL20.glUniformMatrix4(this.shader.getProjectionMatrixLocation(), false, this.matrixBuffer);

    Engine.getInstance().getGame().getCurrentState().getCamera().getViewMatrix().store(this.matrixBuffer);
    this.matrixBuffer.flip();
    GL20.glUniformMatrix4(this.shader.getViewMatrixLocation(), false, this.matrixBuffer);

    this.modelMatrix.store(this.matrixBuffer);
    this.matrixBuffer.flip();
    GL20.glUniformMatrix4(this.shader.getModelMatrixLocation(), false, this.matrixBuffer);

    GL30.glBindVertexArray(this.vao);
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);

    GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, this.ibo);

    GL11.glDrawElements(GL11.GL_TRIANGLES, this.indiceCount, GL11.GL_UNSIGNED_BYTE, 0);

    GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);

    GL20.glDisableVertexAttribArray(0);
    GL30.glBindVertexArray(0);

    this.shader.getShaderProgram().unuse();
}