Top Description Constructors Methods
org.lwjgl.opengl

pack-priv Class GLChecks

extends Object
Class Inheritance
Imports
org.lwjgl.BufferUtils, .LWJGLUtil, java.nio.Buffer, .FloatBuffer

A class to check buffer boundaries in GL methods. Many GL methods read data from the GL into a native Buffer at its current position. If there is unsufficient space in the buffer when the call is made then a buffer overflow would otherwise occur and cause unexpected behaviour, a crash, or worse, a security risk. Therefore in those methods where GL reads data back into a buffer, we will call a bounds check method from this class to ensure that there is sufficient space in the buffer.

Thrown by the debug build library of the LWJGL if any OpenGL operation causes an error.

Author
cix_foo
Version
$Revision$ $Id$

Constructor Summary

AccessConstructor and Description
private
GLChecks()

Static methods only!

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
pack-priv static int
calculateBytesPerPathName(int pathNameType)

private static int
calculateBytesPerPixel(int format, int type)

pack-priv static int

Returns:

the size, in elements, of the image
calculateImageStorage
(Buffer buffer, int
The format of the image (example: GL_RGBA)
format
,
int
The type of the image elements (example: GL_UNSIGNED_BYTE)
type
,
int
The width of the image
width
,
int
The height of the image (1 for 1D images)
height
,
int
The depth of the image (1 for 2D images)
depth
)

Calculate the storage required for an image in elements

private static int

Returns:

the size, in bytes, of the image
calculateImageStorage
(int
The format of the image (example: GL_RGBA)
format
,
int
The type of the image elements (example: GL_UNSIGNED_BYTE)
type
,
int
The width of the image
width
,
int
The height of the image (1 for 1D images)
height
,
int
The depth of the image (1 for 2D images)
depth
)

Calculate the storage required for an image in bytes.

pack-priv static int
calculateMetricsSize(int metricQueryMask, int stride)

pack-priv static int
calculatePathColorGenCoeffsCount(int genMode, int colorFormat)

private static int
pack-priv static int
pack-priv static int
calculateTexImage1DStorage(Buffer buffer, int format, int type, int width)

private static int
calculateTexImage1DStorage(int format, int type, int width)

pack-priv static int
calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height)

private static int
calculateTexImage2DStorage(int format, int type, int width, int height)

pack-priv static int
calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth)

private static int
calculateTexImage3DStorage(int format, int type, int width, int height, int depth)

pack-priv static int
calculateTransformPathValues(int transformType)

pack-priv static void
ensureArrayVBOdisabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are disabled.

pack-priv static void
ensureArrayVBOenabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are enabled.

pack-priv static void
ensureElementVBOdisabled(ContextCapabilities caps)

Helper method to ensure that element array buffer objects are disabled.

pack-priv static void
ensureElementVBOenabled(ContextCapabilities caps)

Helper method to ensure that element array buffer objects are enabled.

pack-priv static void
ensureIndirectBOdisabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are disabled.

pack-priv static void
ensureIndirectBOenabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are enabled.

pack-priv static void
ensurePackPBOdisabled(ContextCapabilities caps)

Helper method to ensure that pixel pack buffer objects are disabled.

pack-priv static void
ensurePackPBOenabled(ContextCapabilities caps)

Helper method to ensure that pixel pack buffer objects are enabled.

pack-priv static void
ensureUnpackPBOdisabled(ContextCapabilities caps)

Helper method to ensure that pixel unpack buffer objects are disabled.

pack-priv static void
ensureUnpackPBOenabled(ContextCapabilities caps)

Helper method to ensure that pixel unpack buffer objects are enabled.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

GLChecksback to summary
private GLChecks()

Static methods only!

Method Detail

calculateBytesPerCharCodeback to summary
pack-priv static int calculateBytesPerCharCode(int type)
calculateBytesPerPathNameback to summary
pack-priv static int calculateBytesPerPathName(int pathNameType)
calculateBytesPerPixelback to summary
private static int calculateBytesPerPixel(int format, int type)
calculateImageStorageback to summary
pack-priv static int calculateImageStorage(Buffer buffer, int format, int type, int width, int height, int depth)

Calculate the storage required for an image in elements

Parameters
format:int

The format of the image (example: GL_RGBA)

type:int

The type of the image elements (example: GL_UNSIGNED_BYTE)

width:int

The width of the image

height:int

The height of the image (1 for 1D images)

depth:int

The depth of the image (1 for 2D images)

Returns:int

the size, in elements, of the image

calculateImageStorageback to summary
private static int calculateImageStorage(int format, int type, int width, int height, int depth)

Calculate the storage required for an image in bytes.

Parameters
format:int

The format of the image (example: GL_RGBA)

type:int

The type of the image elements (example: GL_UNSIGNED_BYTE)

width:int

The width of the image

height:int

The height of the image (1 for 1D images)

depth:int

The depth of the image (1 for 2D images)

Returns:int

the size, in bytes, of the image

calculateMetricsSizeback to summary
pack-priv static int calculateMetricsSize(int metricQueryMask, int stride)
calculatePathColorGenCoeffsCountback to summary
pack-priv static int calculatePathColorGenCoeffsCount(int genMode, int colorFormat)
calculatePathGenCoeffsPerComponentback to summary
private static int calculatePathGenCoeffsPerComponent(int genMode)
calculatePathTextGenCoeffsPerComponentback to summary
pack-priv static int calculatePathTextGenCoeffsPerComponent(FloatBuffer coeffs, int genMode)
calculateTexImage1DStorageback to summary
pack-priv static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width)
calculateTexImage1DStorageback to summary
private static int calculateTexImage1DStorage(int format, int type, int width)
calculateTexImage2DStorageback to summary
pack-priv static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height)
calculateTexImage2DStorageback to summary
private static int calculateTexImage2DStorage(int format, int type, int width, int height)
calculateTexImage3DStorageback to summary
pack-priv static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth)
calculateTexImage3DStorageback to summary
private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth)
calculateTransformPathValuesback to summary
pack-priv static int calculateTransformPathValues(int transformType)
ensureArrayVBOdisabledback to summary
pack-priv static void ensureArrayVBOdisabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException

ensureArrayVBOenabledback to summary
pack-priv static void ensureArrayVBOenabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException

ensureElementVBOdisabledback to summary
pack-priv static void ensureElementVBOdisabled(ContextCapabilities caps)

Helper method to ensure that element array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException

ensureElementVBOenabledback to summary
pack-priv static void ensureElementVBOenabled(ContextCapabilities caps)

Helper method to ensure that element array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException

ensureIndirectBOdisabledback to summary
pack-priv static void ensureIndirectBOdisabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException

ensureIndirectBOenabledback to summary
pack-priv static void ensureIndirectBOenabled(ContextCapabilities caps)

Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException

ensurePackPBOdisabledback to summary
pack-priv static void ensurePackPBOdisabled(ContextCapabilities caps)

Helper method to ensure that pixel pack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException

ensurePackPBOenabledback to summary
pack-priv static void ensurePackPBOenabled(ContextCapabilities caps)

Helper method to ensure that pixel pack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException

ensureUnpackPBOdisabledback to summary
pack-priv static void ensureUnpackPBOdisabled(ContextCapabilities caps)

Helper method to ensure that pixel unpack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException

ensureUnpackPBOenabledback to summary
pack-priv static void ensureUnpackPBOenabled(ContextCapabilities caps)

Helper method to ensure that pixel unpack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException