Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBOcclusionQuery

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.system.*

Native bindings to the ARB_occlusion_query extension.

This extension defines a mechanism whereby an application can query the number of pixels (or, more precisely, samples) drawn by a primitive or group of primitives.

The primary purpose of such a query (hereafter referred to as an "occlusion query") is to determine the visibility of an object. Typically, the application will render the major occluders in the scene, then perform an occlusion query for the bounding box of each detail object in the scene. Only if said bounding box is visible, i.e., if at least one sample is drawn, should the corresponding object be drawn.

The earlier HP_occlusion_test extension defined a similar mechanism, but it had two major shortcomings.

This extension solves both of those problems. It returns as its result the number of samples that pass the depth and stencil tests, and it encapsulates occlusion queries in "query objects" that allow applications to issue many queries before asking for the result of any one. As a result, they can overlap the time it takes for the occlusion query results to be returned with other, more useful work, such as rendering other parts of the scene or performing other computations on the CPU.

There are many situations where a pixel/sample count, rather than a boolean result, is useful.

Promoted to core in OpenGL 1.5.

Field Summary

Modifier and TypeField and Description
public static final int
GL_CURRENT_QUERY_ARB

Accepted by the pname parameter of GetQueryivARB.

public static final int
GL_QUERY_COUNTER_BITS_ARB

Accepted by the pname parameter of GetQueryivARB.

public static final int
GL_QUERY_RESULT_ARB

Accepted by the pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB.

public static final int
GL_QUERY_RESULT_AVAILABLE_ARB

Accepted by the pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB.

public static final int
GL_SAMPLES_PASSED_ARB

Accepted by the target parameter of BeginQueryARB, EndQueryARB, and GetQueryivARB.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native void
glBeginQueryARB(int target, int
the name of a query object
id
)

Creates a query object and makes it active.

public static void
glDeleteQueriesARB(IntBuffer
an array of query objects to be deleted
ids
)

Deletes named query objects.

public static void
glDeleteQueriesARB(int id)

Deletes named query objects.

public static void
glDeleteQueriesARB(int[] ids)

Array version of: DeleteQueriesARB

public static native void
glEndQueryARB(int target)

Marks the end of the sequence of commands to be tracked for the active query specified by target.

public static void
glGenQueriesARB(IntBuffer
a buffer in which the generated query object names are stored
ids
)

Generates query object names.

public static int
glGenQueriesARB()

Generates query object names.

public static void
glGenQueriesARB(int[] ids)

Array version of: GenQueriesARB

public static int
glGetQueryiARB(int target, int
the symbolic name of a query object target parameter. One of:
QUERY_COUNTER_BITS_ARBCURRENT_QUERY_ARB
pname
)

Returns parameters of a query object target.

public static void
glGetQueryivARB(int target, int
the symbolic name of a query object target parameter. One of:
QUERY_COUNTER_BITS_ARBCURRENT_QUERY_ARB
pname
,
IntBuffer
the requested data
params
)

Returns parameters of a query object target.

public static void
glGetQueryivARB(int target, int pname, int[] params)

Array version of: GetQueryivARB

public static int
glGetQueryObjectiARB(int
the name of a query object
id
,
int
the symbolic name of a query object parameter. One of:
QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
pname
)

Returns the integer value of a query object parameter.

public static void
glGetQueryObjectivARB(int
the name of a query object
id
,
int
the symbolic name of a query object parameter. One of:
QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
pname
,
IntBuffer
the requested data
params
)

Returns the integer value of a query object parameter.

public static void
glGetQueryObjectivARB(int
the name of a query object
id
,
int
the symbolic name of a query object parameter. One of:
QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
pname
,
long
the requested data
params
)

Returns the integer value of a query object parameter.

public static void
glGetQueryObjectivARB(int id, int pname, int[] params)

Array version of: GetQueryObjectivARB

public static int
glGetQueryObjectuiARB(int
the name of a query object
id
,
int
the symbolic name of a query object parameter. One of:
QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
pname
)

Unsigned version of GetQueryObjectivARB.

public static void
glGetQueryObjectuivARB(int
the name of a query object
id
,
int
the symbolic name of a query object parameter. One of:
QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
pname
,
IntBuffer
the requested data
params
)

Unsigned version of GetQueryObjectivARB.

public static void
glGetQueryObjectuivARB(int
the name of a query object
id
,
int
the symbolic name of a query object parameter. One of:
QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
pname
,
long
the requested data
params
)

Unsigned version of GetQueryObjectivARB.

public static void
glGetQueryObjectuivARB(int id, int pname, int[] params)

Array version of: GetQueryObjectuivARB

public static native boolean
glIsQueryARB(int
a value that may be the name of a query object
id
)

Determine if a name corresponds to a query object.

public static native void
nglDeleteQueriesARB(int
the number of query objects to be deleted
n
,
long ids)

Unsafe version of: DeleteQueriesARB

public static native void
nglGenQueriesARB(int
the number of query object names to be generated
n
,
long ids)

Unsafe version of: GenQueriesARB

public static native void
nglGetQueryivARB(int target, int pname, long params)

Unsafe version of: GetQueryivARB

public static native void
nglGetQueryObjectivARB(int id, int pname, long params)

Unsafe version of: GetQueryObjectivARB

public static native void
nglGetQueryObjectuivARB(int id, int pname, long params)

Unsafe version of: GetQueryObjectuivARB

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GL_CURRENT_QUERY_ARBback to summary
public static final int GL_CURRENT_QUERY_ARB

Accepted by the pname parameter of GetQueryivARB.

GL_QUERY_COUNTER_BITS_ARBback to summary
public static final int GL_QUERY_COUNTER_BITS_ARB

Accepted by the pname parameter of GetQueryivARB.

GL_QUERY_RESULT_ARBback to summary
public static final int GL_QUERY_RESULT_ARB

Accepted by the pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB.

GL_QUERY_RESULT_AVAILABLE_ARBback to summary
public static final int GL_QUERY_RESULT_AVAILABLE_ARB

Accepted by the pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB.

GL_SAMPLES_PASSED_ARBback to summary
public static final int GL_SAMPLES_PASSED_ARB

Accepted by the target parameter of BeginQueryARB, EndQueryARB, and GetQueryivARB.

Constructor Detail

ARBOcclusionQueryback to summary
protected ARBOcclusionQuery()

Method Detail

glBeginQueryARBback to summary
public static native void glBeginQueryARB(int target, int id)

Creates a query object and makes it active.

Parameters
target:int

the target type of query object established. One of:

SAMPLES_PASSEDPRIMITIVES_GENERATEDTRANSFORM_FEEDBACK_PRIMITIVES_WRITTENTIME_ELAPSED
TIMESTAMPANY_SAMPLES_PASSEDANY_SAMPLES_PASSED_CONSERVATIVE
id:int

the name of a query object

glDeleteQueriesARBback to summary
public static void glDeleteQueriesARB(IntBuffer ids)

Deletes named query objects.

Parameters
ids:IntBuffer

an array of query objects to be deleted

glDeleteQueriesARBback to summary
public static void glDeleteQueriesARB(int id)

Deletes named query objects.

glDeleteQueriesARBback to summary
public static void glDeleteQueriesARB(int[] ids)

Array version of: DeleteQueriesARB

glEndQueryARBback to summary
public static native void glEndQueryARB(int target)

Marks the end of the sequence of commands to be tracked for the active query specified by target.

Parameters
target:int

the query object target. One of:

SAMPLES_PASSEDPRIMITIVES_GENERATEDTRANSFORM_FEEDBACK_PRIMITIVES_WRITTENTIME_ELAPSED
TIMESTAMPANY_SAMPLES_PASSEDANY_SAMPLES_PASSED_CONSERVATIVE
glGenQueriesARBback to summary
public static void glGenQueriesARB(IntBuffer ids)

Generates query object names.

Parameters
ids:IntBuffer

a buffer in which the generated query object names are stored

glGenQueriesARBback to summary
public static int glGenQueriesARB()

Generates query object names.

Annotations
@NativeType:void
glGenQueriesARBback to summary
public static void glGenQueriesARB(int[] ids)

Array version of: GenQueriesARB

glGetQueryiARBback to summary
public static int glGetQueryiARB(int target, int pname)

Returns parameters of a query object target.

Parameters
target:int

the query object target. One of:

SAMPLES_PASSEDPRIMITIVES_GENERATEDTRANSFORM_FEEDBACK_PRIMITIVES_WRITTENTIME_ELAPSED
TIMESTAMPANY_SAMPLES_PASSEDANY_SAMPLES_PASSED_CONSERVATIVE
pname:int

the symbolic name of a query object target parameter. One of:

QUERY_COUNTER_BITS_ARBCURRENT_QUERY_ARB
Annotations
@NativeType:void
glGetQueryivARBback to summary
public static void glGetQueryivARB(int target, int pname, IntBuffer params)

Returns parameters of a query object target.

Parameters
target:int

the query object target. One of:

SAMPLES_PASSEDPRIMITIVES_GENERATEDTRANSFORM_FEEDBACK_PRIMITIVES_WRITTENTIME_ELAPSED
TIMESTAMPANY_SAMPLES_PASSEDANY_SAMPLES_PASSED_CONSERVATIVE
pname:int

the symbolic name of a query object target parameter. One of:

QUERY_COUNTER_BITS_ARBCURRENT_QUERY_ARB
params:IntBuffer

the requested data

glGetQueryivARBback to summary
public static void glGetQueryivARB(int target, int pname, int[] params)

Array version of: GetQueryivARB

glGetQueryObjectiARBback to summary
public static int glGetQueryObjectiARB(int id, int pname)

Returns the integer value of a query object parameter.

Parameters
id:int

the name of a query object

pname:int

the symbolic name of a query object parameter. One of:

QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
Annotations
@NativeType:void
glGetQueryObjectivARBback to summary
public static void glGetQueryObjectivARB(int id, int pname, IntBuffer params)

Returns the integer value of a query object parameter.

Parameters
id:int

the name of a query object

pname:int

the symbolic name of a query object parameter. One of:

QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
params:IntBuffer

the requested data

glGetQueryObjectivARBback to summary
public static void glGetQueryObjectivARB(int id, int pname, long params)

Returns the integer value of a query object parameter.

Parameters
id:int

the name of a query object

pname:int

the symbolic name of a query object parameter. One of:

QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
params:long

the requested data

glGetQueryObjectivARBback to summary
public static void glGetQueryObjectivARB(int id, int pname, int[] params)

Array version of: GetQueryObjectivARB

glGetQueryObjectuiARBback to summary
public static int glGetQueryObjectuiARB(int id, int pname)

Unsigned version of GetQueryObjectivARB.

Parameters
id:int

the name of a query object

pname:int

the symbolic name of a query object parameter. One of:

QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
Annotations
@NativeType:void
glGetQueryObjectuivARBback to summary
public static void glGetQueryObjectuivARB(int id, int pname, IntBuffer params)

Unsigned version of GetQueryObjectivARB.

Parameters
id:int

the name of a query object

pname:int

the symbolic name of a query object parameter. One of:

QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
params:IntBuffer

the requested data

glGetQueryObjectuivARBback to summary
public static void glGetQueryObjectuivARB(int id, int pname, long params)

Unsigned version of GetQueryObjectivARB.

Parameters
id:int

the name of a query object

pname:int

the symbolic name of a query object parameter. One of:

QUERY_RESULT_ARBQUERY_RESULT_AVAILABLE_ARB
params:long

the requested data

glGetQueryObjectuivARBback to summary
public static void glGetQueryObjectuivARB(int id, int pname, int[] params)

Array version of: GetQueryObjectuivARB

glIsQueryARBback to summary
public static native boolean glIsQueryARB(int id)

Determine if a name corresponds to a query object.

Parameters
id:int

a value that may be the name of a query object

Annotations
@NativeType:GLboolean
nglDeleteQueriesARBback to summary
public static native void nglDeleteQueriesARB(int n, long ids)

Unsafe version of: DeleteQueriesARB

Parameters
n:int

the number of query objects to be deleted

nglGenQueriesARBback to summary
public static native void nglGenQueriesARB(int n, long ids)

Unsafe version of: GenQueriesARB

Parameters
n:int

the number of query object names to be generated

nglGetQueryivARBback to summary
public static native void nglGetQueryivARB(int target, int pname, long params)

Unsafe version of: GetQueryivARB

nglGetQueryObjectivARBback to summary
public static native void nglGetQueryObjectivARB(int id, int pname, long params)

Unsafe version of: GetQueryObjectivARB

nglGetQueryObjectuivARBback to summary
public static native void nglGetQueryObjectuivARB(int id, int pname, long params)

Unsafe version of: GetQueryObjectuivARB