Example usage for com.badlogic.gdx.graphics GL20 GL_LINK_STATUS

List of usage examples for com.badlogic.gdx.graphics GL20 GL_LINK_STATUS

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL20 GL_LINK_STATUS.

Prototype

int GL_LINK_STATUS

To view the source code for com.badlogic.gdx.graphics GL20 GL_LINK_STATUS.

Click Source Link

Usage

From source file:com.dragome.gdx.graphics.webgl.DragomeGL20.java

License:Apache License

@Override
public void glGetProgramiv(final int program, final int pname, final IntBuffer params) {
    if (pname == GL20.GL_DELETE_STATUS || pname == GL20.GL_LINK_STATUS || pname == GL20.GL_VALIDATE_STATUS) {
        final boolean result = (Boolean) gl.getProgramParameter(programs.get(program), pname);
        params.put(result ? GL20.GL_TRUE : GL20.GL_FALSE);
    } else {//from ww  w  . j ava  2 s. com
        params.put((Integer) gl.getProgramParameter(programs.get(program), pname));
    }
}

From source file:com.watabou.glwrap.Program.java

License:Open Source License

public void link() {
    Gdx.gl.glLinkProgram(handle);/*  w w w . jav  a 2s . c  om*/

    IntBuffer status = BufferUtils.newIntBuffer(1);
    Gdx.gl.glGetProgramiv(handle, GL20.GL_LINK_STATUS, status);
    if (status.get() == GL20.GL_FALSE) {
        throw new Error(Gdx.gl.glGetProgramInfoLog(handle));
    }
}

From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java

License:Apache License

private int linkProgram(int program) {
    GL20 gl = Gdx.gl20;/*from   w w  w .  ja v  a 2  s.  co  m*/
    if (program == -1)
        return -1;

    gl.glAttachShader(program, vertexShaderHandle);
    gl.glAttachShader(program, fragmentShaderHandle);
    if (geometryShaderHandle >= 0)
        gl.glAttachShader(program, geometryShaderHandle);
    if (tcsHandle >= 0)
        gl.glAttachShader(program, tcsHandle);
    if (tesHandle >= 0)
        gl.glAttachShader(program, tesHandle);

    gl.glLinkProgram(program);

    ByteBuffer tmp = ByteBuffer.allocateDirect(4);
    tmp.order(ByteOrder.nativeOrder());
    IntBuffer intbuf = tmp.asIntBuffer();

    gl.glGetProgramiv(program, GL20.GL_LINK_STATUS, intbuf);
    int linked = intbuf.get(0);
    if (linked == 0) {
        // Gdx.gl20.glGetProgramiv(program, GL20.GL_INFO_LOG_LENGTH, intbuf);
        // int infoLogLength = intbuf.get(0);
        // if (infoLogLength > 1) {
        log = Gdx.gl20.glGetProgramInfoLog(program);
        // }
        return -1;
    }

    return program;
}

From source file:org.teavm.gdx.graphics.webgl.TeaVMGL20.java

License:Apache License

@Override
public void glGetProgramiv(final int program, final int pname, final IntBuffer params) {
    if (pname == GL20.GL_DELETE_STATUS || pname == GL20.GL_LINK_STATUS || pname == GL20.GL_VALIDATE_STATUS) {
        final boolean result = gl.getProgramParameterb(programs.get(program), pname);
        params.put(result ? GL20.GL_TRUE : GL20.GL_FALSE);
    } else {//  w  w  w. ja va  2  s  .  c o  m
        params.put(gl.getProgramParameteri(programs.get(program), pname));
    }
}

From source file:org.teavm.libgdx.TeaVMGL20.java

License:Apache License

@Override
public void glGetProgramiv(int program, int pname, IntBuffer params) {
    if (pname == GL20.GL_DELETE_STATUS || pname == GL20.GL_LINK_STATUS || pname == GL20.GL_VALIDATE_STATUS) {
        boolean result = gl.getProgramParameterb(programs.get(program), pname);
        params.put(result ? GL20.GL_TRUE : GL20.GL_FALSE);
    } else {//from   ww  w .  ja v a 2 s  .  c  o m
        params.put(gl.getProgramParameteri(programs.get(program), pname));
    }
}