Example usage for org.lwjgl.opengl GL20 nglUniformMatrix3fv

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

Introduction

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

Prototype

public static void nglUniformMatrix3fv(int location, int count, boolean transpose, long value) 

Source Link

Document

Unsafe version of: #glUniformMatrix3fv UniformMatrix3fv

Usage

From source file:ar.com.quark.backend.lwjgl.opengl.DesktopGLES20.java

License:Apache License

/**
 * {@inheritDoc}/*from w w  w  . jav  a  2 s .  c o  m*/
 */
@Override
public void glUniformMatrix3fv(int name, boolean transpose, Float32Array buffer) {
    GL20.nglUniformMatrix3fv(name, (buffer.remaining() >> 2) / 9, transpose,
            MemoryUtil.memAddress(buffer.<ByteBuffer>data()));
}

From source file:com.samrj.devil.gl.ShaderProgram.java

License:Open Source License

/**
 * Specifies the value of a uniform variable for this program. Program must
 * be in use. Returns true if and only if the uniform exists and is active.
 * //www . j  a  v  a2 s .  c om
 * @param name The name of the uniform to specify.
 * @return Whether or not the uniform exists and is active.
 */
public boolean uniformMat3(String name, Mat3 matrix) {
    if (DGL.currentProgram() != this)
        throw new IllegalStateException("Program must be in use.");
    int loc = GL20.glGetUniformLocation(id, name);
    if (loc < 0)
        return false;

    long address = MemStack.wrap(matrix);
    GL20.nglUniformMatrix3fv(loc, 1, false, address);
    MemStack.pop();
    return true;
}

From source file:com.samrj.devil.gl.ShaderProgram.java

License:Open Source License

/**
 * Specifies the values of a uniform variable array for this program. Must
 * be in use. Returns true if and only if the uniform exists and is active.
 * /*from  w w w.j  a v a2 s .  c  om*/
 * @param name The name of the uniform array to specify.
 * @param array An array of values to set the uniform to.
 * @return Whether or not the uniform exists and is active.
 */
public boolean uniformMat3v(String name, Mat3... array) {
    if (DGL.currentProgram() != this)
        throw new IllegalStateException("Program must be in use.");
    int loc = GL20.glGetUniformLocation(id, name);
    if (loc < 0)
        return false;

    long address = MemStack.wrapv(array);
    GL20.nglUniformMatrix3fv(loc, array.length, false, address);
    MemStack.pop();
    return true;
}