Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBRobustness

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

Native bindings to the ARB_robustness extension.

Several recent trends in how OpenGL integrates into modern computer systems have created new requirements for robustness and security for OpenGL rendering contexts.

Additionally GPU architectures now support hardware fault detection; for example, video memory supporting ECC (error correcting codes) and error detection. OpenGL contexts should be capable of recovering from hardware faults such as uncorrectable memory errors. Along with recovery from such hardware faults, the recovery mechanism can also allow recovery from video memory access exceptions and system software failures. System software failures can be due to device changes or driver failures.

Demands for increased software robustness and concerns about malware exploiting buffer overflows have lead API designers to provide additional "safe" APIs that bound the amount of data returned by an API query. For example, the safer "snprintf" or "_snprintf" routines are prefered over "sprintf".

The OpenGL API has many such robustness perils. OpenGL queries return (write) some number of bytes to a buffer indicated by a pointer parameter. The exact number of bytes written by existing OpenGL queries is not expressed directly by any specific parameter; instead the number of bytes returned is a complex function of one or more query arguments, sometimes context state such as pixel store modes or the active texture selector, and the current state of an object (such as a texture level's number of total texels). By the standards of modern API design, such queries are not "safe". Making these queries safer involves introducing a new query API with an additional parameter that specifies the number of bytes in the buffer and never writing bytes beyond that limit.

Multi-threaded use of OpenGL contexts in a "share group" allow sharing of objects such as textures and programs. Such sharing in conjunction with concurrent OpenGL commands stream execution by two or more contexts introduces hazards whereby one context can change objects in ways that can cause buffer overflows for another context's OpenGL queries.

The original ARB_vertex_buffer_object extension includes an issue that explicitly states program termination is allowed when out-of-bounds vertex buffer object fetches occur. Modern GPUs capable of DirectX 10 enforce the well-defined behavior of always returning zero values for indices or non-fixed components in this case. Older GPUs may require extra checks to enforce well-defined (and termination free) behavior, but this expense is warranted when processing potentially untrusted content.

The intent of this extension is to address some specific robustness goals:

In one anticipated usage model, WebGL contexts may make use of these robust features to grant greater stability when using untrusted code. WebGL contexts cannot call OpenGL commands directly but rather must route all OpenGL API calls through the web browser. It is then the web browser that configures the context, using the commands in this extension, to enforce safe behavior. In this scenario, the WebGL content cannot specify or change the use of this extension's features itself; the web browser enforces this policy.

There are other well-known robustness issues with the OpenGL API which this extension does not address. For example, selector-based OpenGL commands are a well-known source of programming errors. Code to manipulate texture state may assume the active texture selector is set appropriately when an intervening function call obscures a change to the active texture state resulting in incorrectly updated or queried state. The EXT_direct_state_access extension introduces selector-free OpenGL commands and queries to address that particular issue so this extension does not.

The intent of this extension is NOT to deprecate any existing API and thereby introduce compatibility issues and coding burdens on existing code, but rather to provide new APIs to ensure a level of robustness commensurate with the expectations of modern applications of OpenGL.

Field Summary

Modifier and TypeField and Description
public static final int
GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB

Returned by GetIntegerv when pname is CONTEXT_FLAGS.

public static final int
GL_GUILTY_CONTEXT_RESET_ARB

Returned by GetGraphicsResetStatusARB.

public static final int
GL_INNOCENT_CONTEXT_RESET_ARB

Returned by GetGraphicsResetStatusARB.

public static final int
GL_LOSE_CONTEXT_ON_RESET_ARB

Returned by GetIntegerv and related simple queries when value is RESET_NOTIFICATION_STRATEGY_ARB.

public static final int
GL_NO_RESET_NOTIFICATION_ARB

Returned by GetIntegerv and related simple queries when value is RESET_NOTIFICATION_STRATEGY_ARB.

public static final int
GL_RESET_NOTIFICATION_STRATEGY_ARB

Accepted by the value parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_UNKNOWN_CONTEXT_RESET_ARB

Returned by GetGraphicsResetStatusARB.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native int
glGetGraphicsResetStatusARB()

The symbolic constant returned indicates if the GL context has been in a reset state at any point since the last call to GetGraphicsResetStatusARB.

public static void
public static void
public static void
public static void
public static void
public static void
glGetnColorTableARB(int target, int format, int type, short[] table)

Array version of: GetnColorTableARB

public static void
glGetnColorTableARB(int target, int format, int type, int[] table)

Array version of: GetnColorTableARB

public static void
glGetnColorTableARB(int target, int format, int type, float[] table)

Array version of: GetnColorTableARB

public static void
glGetnCompressedTexImageARB(int target, int
the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
level
,
int
the maximum number of bytes to write into img
bufSize
,
long
a buffer in which to place the returned data
img
)

Robust version of GetCompressedTexImage

public static void
glGetnCompressedTexImageARB(int target, int
the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
level
,
ByteBuffer
a buffer in which to place the returned data
img
)

Robust version of GetCompressedTexImage

public static void
public static void
public static void
glGetnHistogramARB(int
the histogram target. Must be:
HISTOGRAM
target
,
boolean
if TRUE, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not.
reset
,
int format, int type, int
the maximum number of bytes to write into values
bufSize
,
long
a buffer in which to place the returned data
values
)

Robust version of GetHistogram

public static void
glGetnHistogramARB(int
the histogram target. Must be:
HISTOGRAM
target
,
boolean
if TRUE, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not.
reset
,
int format, int type, ByteBuffer
a buffer in which to place the returned data
values
)

Robust version of GetHistogram

public static double
glGetnMapdARB(int
the evaluator map
target
,
int
the information to query
query
)

Robust version of GetMapdv

public static void
glGetnMapdvARB(int
the evaluator map
target
,
int
the information to query
query
,
DoubleBuffer
a buffer in which to place the returned data
data
)

Robust version of GetMapdv

public static void
glGetnMapdvARB(int target, int query, double[] data)

Array version of: GetnMapdvARB

public static float
glGetnMapfARB(int
the evaluator map
target
,
int
the information to query
query
)

Robust version of GetMapfv

public static void
glGetnMapfvARB(int
the evaluator map
target
,
int
the information to query
query
,
FloatBuffer
a buffer in which to place the returned data
data
)

Robust version of GetMapfv

public static void
glGetnMapfvARB(int target, int query, float[] data)

Array version of: GetnMapfvARB

public static int
public static void
public static void
glGetnMapivARB(int target, int query, int[] data)

Array version of: GetnMapivARB

public static void
glGetnMinmaxARB(int
the minmax target. Must be:
MINMAX
target
,
boolean
If TRUE, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum representable value. All values are reset, whether returned or not.
reset
,
int format, int type, int
the maximum number of bytes to write into values
bufSize
,
long
a buffer in which to place the returned data
values
)

Robust version of GetMinmax

public static void
glGetnMinmaxARB(int
the minmax target. Must be:
MINMAX
target
,
boolean
If TRUE, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum representable value. All values are reset, whether returned or not.
reset
,
int format, int type, ByteBuffer
a buffer in which to place the returned data
values
)

Robust version of GetMinmax

public static void
public static void
glGetnPixelMapfvARB(int map, float[] data)

Array version of: GetnPixelMapfvARB

public static void
glGetnPixelMapuivARB(int
the pixel map parameter to query
map
,
IntBuffer
a buffer in which to place the returned data
data
)

Robust version of GetPixelMapuiv

public static void
glGetnPixelMapuivARB(int map, int[] data)

Array version of: GetnPixelMapuivARB

public static void
glGetnPixelMapusvARB(int
the pixel map parameter to query
map
,
ShortBuffer
a buffer in which to place the returned data
data
)

Robust version of GetPixelMapusv

public static void
glGetnPixelMapusvARB(int map, short[] data)

Array version of: GetnPixelMapusvARB

public static void
glGetnPolygonStippleARB(int
the maximum number of bytes to write into pattern
bufSize
,
long
a buffer in which to place the returned pattern
pattern
)

Robust version of GetPolygonStipple

public static void
glGetnPolygonStippleARB(ByteBuffer
a buffer in which to place the returned pattern
pattern
)

Robust version of GetPolygonStipple

public static void
glGetnSeparableFilterARB(int
the filter target. Must be:
SEPARABLE_2D
target
,
int format, int type, int
the maximum number of bytes to write into row
rowBufSize
,
long
a buffer in which to return the filter row
row
,
int
the maximum number of bytes to write into column
columnBufSize
,
long
a buffer in which to return the filter column
column
,
ByteBuffer span)

Robust version of GetSeparableFilter

public static void
public static void
public static void
public static void
public static void
public static void
public static void
public static void
glGetnTexImageARB(int tex, int level, int format, int type, short[] img)

Array version of: GetnTexImageARB

public static void
glGetnTexImageARB(int tex, int level, int format, int type, int[] img)

Array version of: GetnTexImageARB

public static void
glGetnTexImageARB(int tex, int level, int format, int type, float[] img)

Array version of: GetnTexImageARB

public static void
glGetnTexImageARB(int tex, int level, int format, int type, double[] img)

Array version of: GetnTexImageARB

public static double
glGetnUniformdARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
)

Robust version of GetUniformdv

public static void
glGetnUniformdvARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
,
DoubleBuffer
a buffer in which to place the returned data
params
)

Robust version of GetUniformdv

public static void
glGetnUniformdvARB(int program, int location, double[] params)

Array version of: GetnUniformdvARB

public static float
glGetnUniformfARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
)

Robust version of GetUniformfv

public static void
glGetnUniformfvARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
,
FloatBuffer
a buffer in which to place the returned data
params
)

Robust version of GetUniformfv

public static void
glGetnUniformfvARB(int program, int location, float[] params)

Array version of: GetnUniformfvARB

public static int
glGetnUniformiARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
)

Robust version of GetUniformiv

public static void
glGetnUniformivARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
,
IntBuffer
a buffer in which to place the returned data
params
)

Robust version of GetUniformiv

public static void
glGetnUniformivARB(int program, int location, int[] params)

Array version of: GetnUniformivARB

public static int
glGetnUniformuiARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
)

Robust version of GetUniformuiv

public static void
glGetnUniformuivARB(int
the program object to be queried
program
,
int
the location of the uniform variable to be queried
location
,
IntBuffer
a buffer in which to place the returned data
params
)

Robust version of GetUniformuiv

public static void
glGetnUniformuivARB(int program, int location, int[] params)

Array version of: GetnUniformuivARB

public static void
public static void
public static void
public static void
public static void
public static void
glReadnPixelsARB(int x, int y, int width, int height, int format, int type, short[] data)

Array version of: ReadnPixelsARB

public static void
glReadnPixelsARB(int x, int y, int width, int height, int format, int type, int[] data)

Array version of: ReadnPixelsARB

public static void
glReadnPixelsARB(int x, int y, int width, int height, int format, int type, float[] data)

Array version of: ReadnPixelsARB

public static native void
nglGetnColorTableARB(int target, int format, int type, int
the maximum number of bytes to write into table
bufSize
,
long table)

Unsafe version of: GetnColorTableARB

public static native void
nglGetnCompressedTexImageARB(int target, int level, int
the maximum number of bytes to write into img
bufSize
,
long img)

Unsafe version of: GetnCompressedTexImageARB

public static native void
nglGetnConvolutionFilterARB(int target, int format, int type, int
the maximum number of bytes to write into image
bufSize
,
long image)

Unsafe version of: GetnConvolutionFilterARB

public static native void
nglGetnHistogramARB(int target, boolean reset, int format, int type, int
the maximum number of bytes to write into values
bufSize
,
long values)

Unsafe version of: GetnHistogramARB

public static native void
nglGetnMapdvARB(int target, int query, int
the maximum number of bytes to write into data
bufSize
,
long data)

Unsafe version of: GetnMapdvARB

public static native void
nglGetnMapfvARB(int target, int query, int
the maximum number of bytes to write into data
bufSize
,
long data)

Unsafe version of: GetnMapfvARB

public static native void
nglGetnMapivARB(int target, int query, int
the maximum number of bytes to write into data
bufSize
,
long data)

Unsafe version of: GetnMapivARB

public static native void
nglGetnMinmaxARB(int target, boolean reset, int format, int type, int
the maximum number of bytes to write into values
bufSize
,
long values)

Unsafe version of: GetnMinmaxARB

public static native void
nglGetnPixelMapfvARB(int map, int
the maximum number of bytes to write into data
bufSize
,
long data)

Unsafe version of: GetnPixelMapfvARB

public static native void
nglGetnPixelMapuivARB(int map, int
the maximum number of bytes to write into data
bufSize
,
long data)

Unsafe version of: GetnPixelMapuivARB

public static native void
nglGetnPixelMapusvARB(int map, int
the maximum number of bytes to write into data
bufSize
,
long data)

Unsafe version of: GetnPixelMapusvARB

public static native void
nglGetnPolygonStippleARB(int
the maximum number of bytes to write into pattern
bufSize
,
long pattern)

Unsafe version of: GetnPolygonStippleARB

public static native void
nglGetnSeparableFilterARB(int target, int format, int type, int
the maximum number of bytes to write into row
rowBufSize
,
long row, int
the maximum number of bytes to write into column
columnBufSize
,
long column, long span)

Unsafe version of: GetnSeparableFilterARB

public static native void
nglGetnTexImageARB(int tex, int level, int format, int type, int
the maximum number of bytes to write into img
bufSize
,
long img)

Unsafe version of: GetnTexImageARB

public static native void
nglGetnUniformdvARB(int program, int location, int
the maximum number of bytes to write into params
bufSize
,
long params)

Unsafe version of: GetnUniformdvARB

public static native void
nglGetnUniformfvARB(int program, int location, int
the maximum number of bytes to write into params
bufSize
,
long params)

Unsafe version of: GetnUniformfvARB

public static native void
nglGetnUniformivARB(int program, int location, int
the maximum number of bytes to write into params
bufSize
,
long params)

Unsafe version of: GetnUniformivARB

public static native void
nglGetnUniformuivARB(int program, int location, int
the maximum number of bytes to write into params
bufSize
,
long params)

Unsafe version of: GetnUniformuivARB

public static native void
nglReadnPixelsARB(int x, int y, int width, int height, int format, int type, int
the maximum number of bytes to write into data
bufSize
,
long data)

Unsafe version of: ReadnPixelsARB

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait