Example usage for org.lwjgl.opengl GL11 glDisableClientState

List of usage examples for org.lwjgl.opengl GL11 glDisableClientState

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glDisableClientState.

Prototype

public static native void glDisableClientState(@NativeType("GLenum") int cap);

Source Link

Document

Disables a client-side capability.

Usage

From source file:src.graphics.common.MeshBuffer.java

License:Open Source License

public static void render(float scale, float rotation, Vec3D offset, FloatBuffer vertBuffer,
        FloatBuffer normBuffer, FloatBuffer textBuffer, int numFacets) {
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();/*from   www  . j  av a 2s  . c  o m*/
    if (numFacets < 1)
        numFacets = vertBuffer.capacity() / VFP;
    if (offset != null)
        GL11.glTranslatef(offset.x, offset.y, offset.z);
    else
        GL11.glTranslatef(0, 0, 0);
    GL11.glRotatef(rotation, 0, 0, 1);
    GL11.glScalef(scale, scale, scale);
    //
    //  Only set the texture buffer if one has been provided:
    if (textBuffer == null) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
    } else {
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
        GL11.glTexCoordPointer(2, 0, textBuffer);
    }
    //
    //  And only set the normal buffer if one has been provided:
    if (normBuffer == null)
        GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
    else {
        GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
        GL11.glNormalPointer(0, normBuffer);
    }
    //
    //  Bind the vertex buffer and render-
    GL11.glVertexPointer(3, 0, vertBuffer);
    GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, numFacets * 3);
}

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

License:Open Source License

public static void glDisableClientState(int a) {
    GL11.glDisableClientState(a);
}

From source file:vertigo.graphics.lwjgl.LWJGL_Renderer.java

License:Open Source License

private void drawShape(Shape obj) {
    // Geometry: VBO and IBO
    if (obj.isDirty(Node.VBO)) {
        processBO(obj);/*from  w  w w  .  j a v  a  2  s  .c  o  m*/
        obj.setDirty(Node.VBO, false);
    }

    ShaderProg glshader = obj.getMaterial().getShaderMaterial();
    GL20.glUseProgram(glshader.getHandle());

    updateUniform();
    VBO vbo = null;

    for (Attribute attrib : attribute) {
        if (vbo.getType().equals(attrib.getType())) {
            int alocation = GL20.glGetAttribLocation(glshader.getHandle(), attrib.getName());
            GL20.glEnableVertexAttribArray(alocation);
            GL20.glVertexAttribPointer(alocation, attrib.getSize(), GL11.GL_FLOAT, false, vbo.getStride() << 2,
                    0L);
        }
    }

    if (isIndexed) {
        // draw with index
        GL11.glDrawElements(getOpenGLStyle(obj.getDrawingStyle()), /* elements */ ibo.getSize(),
                GL_UNSIGNED_INT, 0L);
        GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);
        GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
        GL20.glDisableVertexAttribArray(0);
    } else {
        // draw without index
        GL11.glDrawArrays(getOpenGLStyle(obj.getDrawingStyle()), 0, capacity / vbo3f.getStride());
        GL20.glDisableVertexAttribArray(0);
        GL30.glBindVertexArray(0);
    }

    GL20.glUseProgram(0);
}

From source file:view.renderer.GridRenderer.java

public void draw() {

    GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
    GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vID);
    GL15.glBufferData(GL15.GL_ARRAY_BUFFER, vB, GL15.GL_STATIC_DRAW);
    GL11.glVertexPointer(2, GL11.GL_INT, 2 * 4, 0L);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, cID);
    GL15.glBufferData(GL15.GL_ARRAY_BUFFER, cB, GL15.GL_STATIC_DRAW);
    GL11.glColorPointer(3, GL11.GL_FLOAT, 3 * 4, 0L);

    GL11.glDrawArrays(GL11.GL_QUADS, 0, (linesX + linesY) * 4);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);

    GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
    GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
}