Example usage for org.lwjgl.opengl GL33 glVertexAttribDivisor

List of usage examples for org.lwjgl.opengl GL33 glVertexAttribDivisor

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL33 glVertexAttribDivisor.

Prototype

public static void glVertexAttribDivisor(@NativeType("GLuint") int index, @NativeType("GLuint") int divisor) 

Source Link

Document

Modifies the rate at which generic vertex attributes advance during instanced rendering.

Usage

From source file:com.badlogic.gdx.backends.jglfw.JglfwGL30.java

License:Apache License

@Override
public void glVertexAttribDivisor(int index, int divisor) {
    GL33.glVertexAttribDivisor(index, divisor);
}

From source file:com.grillecube.client.opengl.GLVertexArray.java

/** Set the bound vbo as an instanced attribute to the vertex array */
public void setAttributeInstanced(int attributeID, int length, int type, boolean normalized, int stride,
        int offset) {
    this.setAttribute(attributeID, length, type, normalized, stride, offset);
    GL33.glVertexAttribDivisor(attributeID, 1);
}

From source file:com.xrbpowered.gl.res.shaders.InstanceBuffer.java

License:Open Source License

public void enable() {
    int offs = 0;
    for (int i = 0; i < elemCount.length; i++) {
        GL20.glEnableVertexAttribArray(attribId + i);
        GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, iboId);
        GL20.glVertexAttribPointer(attribId + i, elemCount[i], GL11.GL_FLOAT, false, stride, offs);
        offs += 4 * elemCount[i];//from  w ww  .  java2s  .  co  m
        GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
        GL33.glVertexAttribDivisor(attribId + i, divisor);
        //         GL20.glGetVertexAttrib(attribId, GL33.GL_VERTEX_ATTRIB_ARRAY_DIVISOR, testParam);
        Client.checkError();
    }
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static void glVertexAttribDivisor(int index, int divisor) {
    GL33.glVertexAttribDivisor(index, divisor);
}

From source file:org.spout.engine.renderer.vertexbuffer.SpoutFloatBuffer.java

License:Open Source License

public void bind(boolean instanced) {
    if (vboId == -1) {
        throw new IllegalStateException("Cannot bind a vertex buffer without data!");
    }//from w w w. jav a 2 s. c o  m
    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vboId);
    SpoutRenderer.checkGLError();

    for (int i = 0; i < elements.length; i++) {
        GL20.glVertexAttribPointer(layout[i], elements[i], GL11.GL_FLOAT, false, stride, offset[i]);
        SpoutRenderer.checkGLError();

        if (instanced) {
            GL33.glVertexAttribDivisor(layout[i], 1);
            SpoutRenderer.checkGLError();
        }
    }
}

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

License:Open Source License

public static void glVertexAttribDivisor(int a, int b) {
    GL33.glVertexAttribDivisor(a, b);
}