Java Code Examples for com.jogamp.opengl.GL3#glGetQueryiv()

The following examples show how to use com.jogamp.opengl.GL3#glGetQueryiv() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Gl_330_query_occlusion.java    From jogl-samples with MIT License 6 votes vote down vote up
@Override
protected boolean begin(GL gl) {

    GL3 gl3 = (GL3) gl;

    boolean validated = true;

    IntBuffer queryCounter = GLBuffers.newDirectIntBuffer(1);
    gl3.glGetQueryiv(GL_ANY_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, queryCounter);
    assert (queryCounter.get(0) > 0);

    if (validated) {
        validated = initProgram(gl3);
    }
    if (validated) {
        validated = initBuffer(gl3);
    }
    if (validated) {
        validated = initVertexArray(gl3);
    }
    if (validated) {
        validated = initQuery(gl3);
    }

    return validated && checkError(gl3, "begin");
}
 
Example 2
Source File: Gl_320_query_conditional.java    From jogl-samples with MIT License 5 votes vote down vote up
@Override
protected boolean begin(GL gl) {

    GL3 gl3 = (GL3) gl;

    boolean validated = true;

    IntBuffer queryCounter = GLBuffers.newDirectIntBuffer(1);
    gl3.glGetQueryiv(GL_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, queryCounter);

    if (validated) {
        validated = initProgram(gl3);
    }
    if (validated) {
        validated = initBuffer(gl3);
    }
    if (validated) {
        validated = initVertexArray(gl3);
    }
    if (validated) {
        validated = initQuery(gl3);
    }

    BufferUtils.destroyDirectBuffer(queryCounter);

    return validated && checkError(gl3, "begin");
}
 
Example 3
Source File: Gl_330_query_counter.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);
        gl3.glGetQueryiv(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 30;
        if (validated) {
            gl3.glGenQueries(queryName.capacity(), queryName);
        }

        BufferUtils.destroyDirectBuffer(queryBits);

        return validated && checkError(gl3, "initQuery");
    }
 
Example 4
Source File: Gl_320_transform_feedback_interleaved.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        gl3.glGenQueries(1, queryName);

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);
        gl3.glGetQueryiv(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 1;

        BufferUtils.destroyDirectBuffer(queryBits);

        return validated && checkError(gl3, "initQuery");
    }
 
Example 5
Source File: Gl_320_transform_feedback_separated.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        gl3.glGenQueries(1, queryName);

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);
        gl3.glGetQueryiv(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 1;

        BufferUtils.destroyDirectBuffer(queryBits);

        return validated && checkError(gl3, "initQuery");
    }
 
Example 6
Source File: Gl_320_primitive_shading.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        gl3.glGenQueries(1, queryName);

        int[] queryBits = {0};
        gl3.glGetQueryiv(GL_PRIMITIVES_GENERATED, GL_QUERY_COUNTER_BITS, queryBits, 0);

        boolean validated = queryBits[0] >= 32;

        return validated && checkError(gl3, "initQuery");
    }
 
Example 7
Source File: Gl_320_query_occlusion.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        gl3.glGenQueries(1, queryName);

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);
        gl3.glGetQueryiv(GL_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 32;

        BufferUtils.destroyDirectBuffer(queryBits);

        return validated && checkError(gl3, "initQuery");
    }
 
Example 8
Source File: Gl_320_query_conditional.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        gl3.glGenQueries(1, queryName);

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);
        gl3.glGetQueryiv(GL_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 32;

        BufferUtils.destroyDirectBuffer(queryBits);

        return validated && checkError(gl3, "initQuery");
    }
 
Example 9
Source File: Gl_330_query_occlusion.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        gl3.glGenQueries(1, queryName);

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);
        gl3.glGetQueryiv(GL_ANY_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 1;

        return validated && checkError(gl3, "initQuery");
    }
 
Example 10
Source File: Gl_330_query_time.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);

        gl3.glGenQueries(1, queryName);

        gl3.glGetQueryiv(GL_TIME_ELAPSED, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 30;

        BufferUtils.destroyDirectBuffer(queryBits);

        return validated && checkError(gl3, "initQuery");
    }
 
Example 11
Source File: Gl_330_query_conditional.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL3 gl3) {

        IntBuffer queryBits = GLBuffers.newDirectIntBuffer(1);

        gl3.glGenQueries(1, queryName);

        gl3.glGetQueryiv(GL_ANY_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, queryBits);

        boolean validated = queryBits.get(0) >= 1;

        BufferUtils.destroyDirectBuffer(queryBits);

        return validated && checkError(gl3, "initQuery");
    }