Top Description Inners Fields Constructors Methods
org.lwjgl.opengl

public Class CGL

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

Native bindings to CGL.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CGL.Functions

Contains the function pointers loaded from GL.getFunctionProvider().

Field Summary

Modifier and TypeField and Description
public static final int
kCGL0Bit

Depth and stencil buffer depths.

public static final int
kCGL10Bit

Depth and stencil buffer depths.

public static final int
kCGL128Bit

Depth and stencil buffer depths.

public static final int
kCGL12Bit

Depth and stencil buffer depths.

public static final int
kCGL16Bit

Depth and stencil buffer depths.

public static final int
kCGL1Bit

Depth and stencil buffer depths.

public static final int
kCGL24Bit

Depth and stencil buffer depths.

public static final int
kCGL2Bit

Depth and stencil buffer depths.

public static final int
kCGL32Bit

Depth and stencil buffer depths.

public static final int
kCGL3Bit

Depth and stencil buffer depths.

public static final int
kCGL48Bit

Depth and stencil buffer depths.

public static final int
kCGL4Bit

Depth and stencil buffer depths.

public static final int
kCGL5Bit

Depth and stencil buffer depths.

public static final int
kCGL64Bit

Depth and stencil buffer depths.

public static final int
kCGL6Bit

Depth and stencil buffer depths.

public static final int
kCGL8Bit

Depth and stencil buffer depths.

public static final int
kCGL96Bit

Depth and stencil buffer depths.

public static final int
kCGLARGB12121212Bit

Color and accumulation buffer formats.

public static final int
kCGLARGB1555Bit

Color and accumulation buffer formats.

public static final int
kCGLARGB2101010Bit

Color and accumulation buffer formats.

public static final int
kCGLARGB4444Bit

Color and accumulation buffer formats.

public static final int
kCGLARGB8888Bit

Color and accumulation buffer formats.

public static final int
kCGLBadAddress

CGL error return values.

public static final int
kCGLBadAlloc

CGL error return values.

public static final int
kCGLBadAttribute

CGL error return values.

public static final int
kCGLBadCodeModule

CGL error return values.

public static final int
kCGLBadConnection

CGL error return values.

public static final int
kCGLBadContext

CGL error return values.

public static final int
kCGLBadDisplay

CGL error return values.

public static final int
kCGLBadDrawable

CGL error return values.

public static final int
kCGLBadEnumeration

CGL error return values.

public static final int
kCGLBadFullScreen

CGL error return values.

public static final int
kCGLBadMatch

CGL error return values.

public static final int
kCGLBadOffScreen

CGL error return values.

public static final int
kCGLBadPixelFormat

CGL error return values.

public static final int
kCGLBadProperty

CGL error return values.

public static final int
kCGLBadRendererInfo

CGL error return values.

public static final int
kCGLBadState

CGL error return values.

public static final int
kCGLBadValue

CGL error return values.

public static final int
kCGLBadWindow

CGL error return values.

public static final int
public static final int
kCGLCEMPEngine

Enable names for Enable, Disable, and IsEnabled.

public static final int
public static final int
public static final int
public static final int
kCGLCESwapLimit

Enable names for Enable, Disable, and IsEnabled.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
kCGLDoubleBufferBit

Buffer modes.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
kCGLMonoscopicBit

Buffer modes.

public static final int
kCGLMultisampleBit

Sampling modes.

public static final int
kCGLNoError

CGL error return values.

public static final int
kCGLOGLPVersion_3_2_Core

OpenGL Implementation Profiles.

public static final int
kCGLOGLPVersion_Legacy

OpenGL Implementation Profiles.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
kCGLRGB101010_A8Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB101010Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB121212Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB161616Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB444A8Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB444Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB555A8Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB555Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB565A8Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB565Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB888A8Bit

Color and accumulation buffer formats.

public static final int
kCGLRGB888Bit

Color and accumulation buffer formats.

public static final int
kCGLRGBA16161616Bit

Color and accumulation buffer formats.

public static final int
kCGLRGBAFloat128Bit

Color and accumulation buffer formats.

public static final int
kCGLRGBAFloat256Bit

Color and accumulation buffer formats.

public static final int
kCGLRGBAFloat64Bit

Color and accumulation buffer formats.

public static final int
kCGLRGBFloat128Bit

Color and accumulation buffer formats.

public static final int
kCGLRGBFloat256Bit

Color and accumulation buffer formats.

public static final int
kCGLRGBFloat64Bit

Color and accumulation buffer formats.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
kCGLRPCompliant

Property names for DescribeRenderer.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
kCGLRPMPSafe

Property names for DescribeRenderer.

public static final int
public static final int
kCGLRPOffScreen

Property names for DescribeRenderer.

public static final int
kCGLRPOnline

Property names for DescribeRenderer.

public static final int
public static final int
public static final int
kCGLRPRobust

Property names for DescribeRenderer.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
kCGLRPWindow

Property names for DescribeRenderer.

public static final int
kCGLSingleBufferBit

Buffer modes.

public static final int
kCGLStereoscopicBit

Buffer modes.

public static final int
kCGLSupersampleBit

Sampling modes.

public static final int
kCGLTripleBufferBit

Buffer modes.

Constructor Summary

AccessConstructor and Description
protected
CGL()

Method Summary

Modifier and TypeMethod and Description
public static int
CGLChoosePixelFormat(IntBuffer attribs, PointerBuffer
the memory address of a pixel format object. On return, points to a new pixel format object that contains pixel format information and a list of virtual screens. If there are no pixel formats or virtual screens that satisfy the constraints of the buffer and renderer attributes, the value of pix is set to NULL.
pix
,
IntBuffer
on return, points to the number of virtual screens referenced by pix. If pix is NULL, the value of npix is set to 0.
npix
)

Creates a pixel format object that satisfies the constraints of the specified buffer and renderer attributes.

public static int
CGLChoosePixelFormat(int[] attribs, PointerBuffer pix, int[] npix)

Array version of: ChoosePixelFormat

public static int
CGLClearDrawable(long
a rendering context
ctx
)

Disassociates a rendering context from any drawable objects attached to it.

public static int
CGLCopyContext(long
the source rendering context
src
,
long
the destination rendering context
dst
,
int
a mask that specifies the state variables to copy. Pass a bit field that contains the bitwise OR of the state variable names that you want to copy. Use the symbolic mask constants that are passed to the OpenGL function PushAttrib. To copy as many state variables as possible, supply the constant ALL_ATTRIB_BITS.
mask
)

Copies the specified state variables from one rendering context to another.

public static int
CGLCreateContext(long
a pixel format object created by calling the function ChoosePixelFormat
pix
,
long
the rendering context with which to share the OpenGL object state — including texture objects, programs and shader display lists, vertex array objects, vertex buffer objects, pixel buffer objects, and frame buffer objects — and the object state associated which each of these object types. Pass NULL to indicate that no sharing is to take place.
share
,
PointerBuffer
the memory address of a context object. On return, points to a new context object with the buffers and attributes specified by the pix parameter. If the context can not be created as specified, the value of ctx is set to NULL.
ctx
)

Creates a CGL rendering context.

public static int
CGLCreatePBuffer(int
the width, in pixels, of the pixel buffer
width
,
int
the height, in pixels, of the pixel buffer
height
,
int
a constant that specifies the type of the pixel buffer target texture. One of:
TEXTURE_2DTEXTURE_CUBE_MAPTEXTURE_RECTANGLE
target
,
int
a constant that specifies the internal color format of the pixel buffer. The format controls whether the alpha channel of the pixel buffer is used for texturing operations. One of:
RGBGL11#GL_RGBA
internalFormat
,
int
the maximum level of mipmap detail allowable. Pass 0 for a pixel buffer that is not using mipmaps. The value passed should never exceed the actual maximum number of mipmap levels that can be represented with the given width and height.
max_level
,
PointerBuffer
on return, points to a new pixel buffer object
pbuffer
)

Creates a pixel buffer of the specified size, compatible with the specified texture target.

public static int
CGLDescribePBuffer(long
a pointer to the pixel buffer object
obj
,
IntBuffer
on return, points to the width, in pixels, of the pixel buffer
width
,
IntBuffer
on return, points to the height, in pixels, of the pixel buffer
height
,
IntBuffer
on return, points to a constant that specifies the pixel buffer texture target
target
,
IntBuffer
on return, points to a constant that specifies the internal color format of the pixel buffer
internalFormat
,
IntBuffer
on return, points to the mipmap level of the pixel buffer or 0 if it doesn't use mipmaps
mipmap
)

Retrieves information that describes the specified pixel buffer object.

public static int
CGLDescribePBuffer(long obj, int[] width, int[] height, int[] target, int[] internalFormat, int[] mipmap)

Array version of: DescribePBuffer

public static int
public static int
CGLDescribePixelFormat(long pix, int pix_num, int attrib, int[] value)

Array version of: DescribePixelFormat

public static int
CGLDescribeRenderer(long
an opaque renderer information object that contains a description of the renderer capabilities you want to inspect. You can obtain a renderer information object by calling the function QueryRendererInfo. You must call DestroyRendererInfo when you no longer need this object.
rend
,
int
the index of the renderer inside the renderer information object — a value between 0 and the number of renderers minus one. The number of renderers can be obtained by calling DescribeRenderer, passing in rend, renderer number 0, and the renderer property RPRendererCount.
rend_num
,
int prop, IntBuffer
on return, points to the value of the requested property
value
)

Obtains the value associated with a renderer property.

public static int
CGLDescribeRenderer(long rend, int rend_num, int prop, int[] value)

Array version of: DescribeRenderer

public static int
CGLDestroyContext(long
the rendering context to destroy
ctx
)

Frees the resources associated with a rendering context.

public static int
CGLDestroyPBuffer(long
the pixel buffer object whose resources you want to release
pbuffer
)

Releases the resources associated with a pixel buffer object.

public static int
CGLDestroyPixelFormat(long
the pixel format object to destroy
pix
)

Frees the memory associated with a pixel format object.

public static int
CGLDestroyRendererInfo(long
the renderer information object to destroy
rend
)

Frees resources associated with a renderer information object.

public static int
CGLDisable(long
a rendering context
ctx
,
int pname)

Disables an option for a rendering context.

public static int
CGLEnable(long
a rendering context
ctx
,
int pname)

Enables an option for a rendering context.

public static String
public static int
CGLFlushDrawable(long
the context object
ctx
)

Copies the back buffer of a double-buffered context to the front buffer.

public static int
CGLGetContextRetainCount(long
the CGL rendering context whose retain count you wish to discover
ctx
)

Returns the current retain count of a CGL rendering context.

public static long
CGLGetCurrentContext()

Returns the current rendering context.

public static int
CGLGetGlobalOption(int pname, IntBuffer
on return, a pointer to the value of the option
params
)

Retrieves the value of a global option.

public static int
CGLGetGlobalOption(int pname, int[] params)

Array version of: GetGlobalOption

public static int
CGLGetOffScreen(long
a rendering context
ctx
,
IntBuffer
on return, points to the width, in pixels, of the offscreen buffer. If the rendering context is not attached to an offscreen drawable object, the value of width is set to 0.
width
,
IntBuffer
on return, points to the height, in pixels, of the offscreen buffer. If the rendering context is not attached to an offscreen drawable object, the value of height is set to 0.
height
,
IntBuffer
on return, points to the number of bytes per row of the offscreen buffer. If the context is not attached to an offscreen drawable object, the value of rowbytes is set to 0.
rowbytes
,
PointerBuffer
on return, points to the base address of the offscreen buffer. If the context is not attached to an offscreen drawable object, the value of baseaddr is set to NULL.
baseaddr
)

Retrieves an offscreen buffer and its parameters for a specified rendering context.

public static int
CGLGetOffScreen(long ctx, int[] width, int[] height, int[] rowbytes, PointerBuffer baseaddr)

Array version of: GetOffScreen

public static int
CGLGetParameter(long
a rendering context
ctx
,
int pname, IntBuffer
on return, points to the value of the parameter
params
)

Retrieves the value of a rendering context parameter.

public static int
CGLGetParameter(long ctx, int pname, int[] params)

Array version of: GetParameter

public static int
CGLGetPBuffer(long
a rendering context
ctx
,
PointerBuffer
on return, points to the pixel buffer object attached to the rendering context
pbuffer
,
IntBuffer
on return, points to the cube map face that is set if the pixel buffer texture target type is TEXTURE_CUBE_MAP; otherwise 0 for all other texture target types.
face
,
IntBuffer
on return, points to the current mipmap level for drawing
level
,
IntBuffer
on return, points to the current virtual screen number, as set by the last valid call to SetPBuffer
screen
)

Retrieves a pixel buffer and its parameters for a specified rendering context.

public static int
CGLGetPBuffer(long ctx, PointerBuffer pbuffer, int[] face, int[] level, int[] screen)

Array version of: GetPBuffer

public static int
CGLGetPBufferRetainCount(long
the pixel buffer object whose retain count you wish to retrieve
pbuffer
)

Returns the retain count of a pixel buffer object.

public static long
CGLGetPixelFormat(long
the CGL rendering context whose format you want to receive
ctx
)

Retrieves the current pixel format associated with a CGL rendering context.

public static int
CGLGetPixelFormatRetainCount(long
a pixel format object
pix
)

Returns the retain count of a pixel format object.

public static long
CGLGetShareGroup(long
a rendering context
ctx
)

Returns the sharegroup of the specified rendering context.

public static void
CGLGetVersion(IntBuffer
on return, points to the major version number of the CGL library
majorvers
,
IntBuffer
on return, points to the minor version number of the CGL library
minorvers
)

Gets the major and minor version numbers of the CGL library.

public static void
CGLGetVersion(int[] majorvers, int[] minorvers)

Array version of: GetVersion

public static int
CGLGetVirtualScreen(long
a rendering context
ctx
,
IntBuffer
on return, points to the virtual screen associated with the context. The value is always 0 on a single-display system and –1 if the function fails for any reason.
screen
)

Gets the current virtual screen number associated with a rendering context.

public static int
CGLGetVirtualScreen(long ctx, int[] screen)

Array version of: GetVirtualScreen

public static int
CGLIsEnabled(long
a rendering context
ctx
,
int pname, IntBuffer
on return, enable is set to true if the option is enabled
enable
)

Reports whether an option is enabled for a rendering context.

public static int
CGLIsEnabled(long ctx, int pname, int[] enable)

Array version of: IsEnabled

public static int
CGLLockContext(long
a rendering context
context
)

Locks a CGL rendering context.

public static int
CGLQueryRendererInfo(int
a bit field that contains the bitwise OR of OpenGL display masks returned by the CGDisplayIDToOpenGLDisplayMask function. If you want to obtain information for all renderers in the system you must call CGLQueryRendererInfo once for each display bit.
display_mask
,
PointerBuffer
the memory address of a renderer information object. On return, points to a renderer information object that describes all renderers that are able to drive the displays specified by the display_mask parameter. If display_mask does not specify any displays, the value of rend is set to NULL. You must call DestroyRendererInfo when you no longer need this object.
rend
,
IntBuffer
on return, points to the number of renderers described in the renderer information object. If display_mask does not specify any displays, the value of nrend is set to 0.
nrend
)

Creates a renderer information object that contains properties and values for renderers able to drive all the specified displays in a given display mask.

public static int
CGLQueryRendererInfo(int display_mask, PointerBuffer rend, int[] nrend)

Array version of: QueryRendererInfo

public static void
CGLReleaseContext(long
the rendering context to be released
ctx
)

Decrements the retain count on a CGL rendering context.

public static void
CGLReleasePBuffer(long
the pixel buffer object whose resources you want to release
pbuffer
)

Releases the resources associated with a pixel buffer object.

public static void
CGLReleasePixelFormat(long
the pixel format object whose reference count should be decremented
pix
)

Decrements the reference count of a pixel format object.

public static long

Returns:

the same context that was passed into the function.
CGLRetainContext
(long
the rendering context to be retained
ctx
)

Increments the retain count on a CGL rendering context.

public static long
CGLRetainPBuffer(long
the pixel buffer object whose retain count you wish to increment
pbuffer
)

Increments the retain count on a pixel buffer object.

public static long
CGLRetainPixelFormat(long
the pixel format object whose reference count should be incremented
pix
)

Increments the receiver's reference count.

public static int
CGLSetCurrentContext(long
the rendering context to set as the current rendering context. Pass NULL to release the current rendering context without assigning a new one.
context
)

Sets the specified rendering context as the current rendering context.

public static int
CGLSetFullScreen(long
a rendering context
ctx
)

Attaches a rendering context to its full-screen drawable object.

public static int
CGLSetFullScreenOnDisplay(long
a rendering context
ctx
,
int
a bit field that contains the OpenGL display mask for the screen you wish the context to cover
display_mask
)

Attaches a rendering context to a full-screen drawable object." +

This function obtains a drawable object that covers an entire screen and attaches it to the rendering context.

public static int
CGLSetGlobalOption(int pname, IntBuffer
the value to set the option to
params
)

Sets the value of a global option.

public static int
CGLSetGlobalOption(int pname, int param)

Sets the value of a global option.

public static int
CGLSetGlobalOption(int pname, int[] params)

Array version of: SetGlobalOption

public static int
CGLSetOffScreen(long
a rendering context
ctx
,
int
the width, in pixels, of the offscreen buffer
width
,
int
the height, in pixels, of the offscreen buffer
height
,
int
the number of bytes per row of the offscreen buffer, which must be greater than or equal to width times bytes per pixel
rowbytes
,
ByteBuffer
a pointer to a block of memory to use as the offscreen buffer. The size of the memory must be at least rowbytes*height bytes.
baseaddr
)

Attaches a rendering context to an offscreen buffer.

public static int
CGLSetParameter(long
a rendering context
ctx
,
int pname, IntBuffer
a pointer to the value to set the parameter to
params
)

Sets the value of a rendering context parameter.

public static int
public static int
CGLSetParameter(long ctx, int pname, int[] params)

Array version of: SetParameter

public static int
CGLSetPBuffer(long
the rendering context to attach the pixel buffer to
ctx
,
long
a pixel buffer object
pbuffer
,
int
the cube map face to draw if the pixel buffer texture target type is TEXTURE_CUBE_MAP; otherwise pass 0.
face
,
int
the mipmap level to draw. This must not exceed the maximum mipmap level set when the pixel buffer object was created. Pass 0 for a texture target that does not support mipmaps.
level
,
int
a virtual screen value. The virtual screen determines the renderer OpenGL uses to draw to the pixel buffer object. For best performance, for a pixel buffer used as a texture source, you should supply the virtual screen value that results in using the same renderer used by the context that's the texturing target.
screen
)

Attaches a pixel buffer object to a rendering context.

public static int
CGLSetVirtualScreen(long
a rendering context
ctx
,
int
a virtual screen number, which must be a value between 0 and the number of virtual screens minus one. The number of virtual screens available in a context can be obtained by calling the function DescribePixelFormat, passing in the pixel format object used to create the rendering context, 0 for the virtual screen number (pix_num parameter), and the attribute constant PFAVirtualScreenCount.
screen
)

Forces subsequent OpenGL commands to the specified virtual screen.

public static int
CGLTexImagePBuffer(long
a rendering context, which is the target context for the texture operation. This is the context that you plan to render content to. This is not the context attached to the pixel buffer.
ctx
,
long
a pixel buffer object
pbuffer
,
int
the source buffer to get the texture from, which should be a valid OpenGL buffer such as GL_FRONT or GL_BACK and should be compatible with the buffer and renderer attributes that you used to create the rendering context attached to the pixel buffer. This means that the pixel buffer must possess the buffer in question for the texturing operation to succeed.
source
)

Binds the contents of a pixel buffer to a data source for a texture object.

public static int
CGLUnlockContext(long
the CGL context to unlock
context
)

Unlocks a CGL rendering context.

public static int
CGLUpdateContext(long
a rendering context
ctx
)

Synchronizes new renderer state to that of the application context

public static int
nCGLChoosePixelFormat(long attribs, long pix, long npix)

Unsafe version of: ChoosePixelFormat

public static int
nCGLCreateContext(long pix, long share, long ctx)

Unsafe version of: CreateContext

public static int
nCGLCreatePBuffer(int width, int height, int target, int internalFormat, int max_level, long pbuffer)

Unsafe version of: CreatePBuffer

public static int
nCGLDescribePBuffer(long obj, long width, long height, long target, long internalFormat, long mipmap)

Unsafe version of: DescribePBuffer

public static int
nCGLDescribePixelFormat(long pix, int pix_num, int attrib, long value)

Unsafe version of: DescribePixelFormat

public static int
nCGLDescribeRenderer(long rend, int rend_num, int prop, long value)

Unsafe version of: DescribeRenderer

public static long
nCGLErrorString(int error)

Unsafe version of: ErrorString

public static int
nCGLGetGlobalOption(int pname, long params)

Unsafe version of: GetGlobalOption

public static int
nCGLGetOffScreen(long ctx, long width, long height, long rowbytes, long baseaddr)

Unsafe version of: GetOffScreen

public static int
nCGLGetParameter(long ctx, int pname, long params)

Unsafe version of: GetParameter

public static int
nCGLGetPBuffer(long ctx, long pbuffer, long face, long level, long screen)

Unsafe version of: GetPBuffer

public static void
nCGLGetVersion(long majorvers, long minorvers)

Unsafe version of: GetVersion

public static int
nCGLGetVirtualScreen(long ctx, long screen)

Unsafe version of: GetVirtualScreen

public static int
nCGLIsEnabled(long ctx, int pname, long enable)

Unsafe version of: IsEnabled

public static int
nCGLQueryRendererInfo(int display_mask, long rend, long nrend)

Unsafe version of: QueryRendererInfo

public static int
nCGLSetGlobalOption(int pname, long params)

Unsafe version of: SetGlobalOption

public static int
nCGLSetOffScreen(long ctx, int width, int height, int rowbytes, long baseaddr)

Unsafe version of: SetOffScreen

public static int
nCGLSetParameter(long ctx, int pname, long params)

Unsafe version of: SetParameter

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait