Example usage for org.lwjgl.opengl ARBUniformBufferObject glGetUniformIndices

List of usage examples for org.lwjgl.opengl ARBUniformBufferObject glGetUniformIndices

Introduction

In this page you can find the example usage for org.lwjgl.opengl ARBUniformBufferObject glGetUniformIndices.

Prototype

public static void glGetUniformIndices(@NativeType("GLuint") int program,
        @NativeType("GLchar const **") PointerBuffer uniformNames,
        @NativeType("GLuint *") int[] uniformIndices) 

Source Link

Document

Array version of: #glGetUniformIndices GetUniformIndices

Usage

From source file:jpcsp.graphics.RE.RenderingEngineLwjgl.java

License:Open Source License

@Override
public int getUniformIndex(int program, String name) {
    IntBuffer indicesBuffer = DirectBufferUtilities.allocateDirectBuffer(4).asIntBuffer();
    ARBUniformBufferObject.glGetUniformIndices(program, new String[] { name }, indicesBuffer);
    return indicesBuffer.get(0);
}

From source file:jpcsp.graphics.RE.RenderingEngineLwjgl.java

License:Open Source License

@Override
public int[] getUniformIndices(int program, String[] names) {
    IntBuffer indicesBuffer = DirectBufferUtilities.allocateDirectBuffer(names.length << 2).asIntBuffer();
    ARBUniformBufferObject.glGetUniformIndices(program, names, indicesBuffer);
    int[] indices = new int[names.length];
    indicesBuffer.get(indices);/*from   ww  w .  java2s . c  om*/
    return indices;
}