Top Description Fields Constructors Methods
org.lwjgl.opengl

public final Class Pbuffer

extends DrawableGL
Class Inheritance
Imports
java.nio.IntBuffer, org.lwjgl.BufferUtils, .LWJGLException, .Sys

Pbuffer encapsulates an OpenGL pbuffer.

This class is thread-safe.

Author
elias_naur
Version
$Revision$ $Id$

Field Summary

Modifier and TypeField and Description
public static final int
BACK_LEFT_BUFFER

The Pbuffer back left buffer.

public static final int
BACK_RIGHT_BUFFER

The Pbuffer back right buffer.

public static final int
CUBE_MAP_FACE

The render-to-texture cube map face attribute.

public static final int
DEPTH_BUFFER

The Pbuffer depth buffer.

public static final int
FRONT_LEFT_BUFFER

The Pbuffer front left buffer.

public static final int
FRONT_RIGHT_BUFFER

The Pbuffer front right buffer.

private final int
height

Height

public static final int
MIPMAP_LEVEL

The render-to-texture mipmap level attribute.

public static final int
PBUFFER_SUPPORTED

Indicates that Pbuffers can be created.

public static final int
RENDER_DEPTH_TEXTURE_SUPPORTED

Indicates that Pbuffers can be used as depth render-textures.

public static final int
RENDER_TEXTURE_RECTANGLE_SUPPORTED

Indicates that Pbuffers can be used as non-power-of-two render-textures.

public static final int
RENDER_TEXTURE_SUPPORTED

Indicates that Pbuffers can be used as render-textures.

public static final int
TEXTURE_CUBE_MAP_NEGATIVE_X

The render-to-texture cube map negative X face value.

public static final int
TEXTURE_CUBE_MAP_NEGATIVE_Y

The render-to-texture cube map negative Y face value.

public static final int
TEXTURE_CUBE_MAP_NEGATIVE_Z

The render-to-texture cube map negative Z face value.

public static final int
TEXTURE_CUBE_MAP_POSITIVE_X

The render-to-texture cube map positive X face value.

public static final int
TEXTURE_CUBE_MAP_POSITIVE_Y

The render-to-texture cube map positive Y face value.

public static final int
TEXTURE_CUBE_MAP_POSITIVE_Z

The render-to-texture cube map positive Z face value.

private final int
width

Width

Inherited from org.lwjgl.opengl.DrawableGL:
contextpeer_infopixel_format

Constructor Summary

AccessConstructor and Description
public
Pbuffer(int
Pbuffer width
width
,
int
Pbuffer height
height
,
PixelFormat
Minimum Pbuffer context properties
pixel_format
,
Drawable
If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share with the Display context (if created).
shared_drawable
)

Create an instance of a Pbuffer with a unique OpenGL context.

public
Pbuffer(int
Pbuffer width
width
,
int
Pbuffer height
height
,
PixelFormat
Minimum Pbuffer context properties
pixel_format
,
RenderTexture renderTexture, Drawable
If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share with the Display context (if created).
shared_drawable
)

Create an instance of a Pbuffer with a unique OpenGL context.

public
Pbuffer(int
Pbuffer width
width
,
int
Pbuffer height
height
,
PixelFormat
Minimum Pbuffer context properties
pixel_format
,
RenderTexture renderTexture, Drawable
If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share with the Display context (if created).
shared_drawable
,
ContextAttribs
The ContextAttribs to use when creating the context. (optional, may be null)
attribs
)

Create an instance of a Pbuffer with a unique OpenGL context.

Method Summary

Modifier and TypeMethod and Description
public synchronized void
bindTexImage(int buffer)

Binds the currently bound texture to the buffer specified.

private static PeerInfo
createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, RenderTexture renderTexture)

public static int

Returns:

a bitmask of Pbuffer capabilities.
getCapabilities
()

Gets the Pbuffer capabilities.

public synchronized int

Returns:

Returns the height.
getHeight
()

public synchronized int

Returns:

Returns the width.
getWidth
()

public synchronized boolean

Returns:

true if the buffer is lost and destroyed, false if the buffer is valid.
isBufferLost
()

Method to test for validity of the buffer.

public synchronized void
releaseTexImage(int buffer)

Releases the currently bound texture from the buffer specified.

public synchronized void
setAttrib(int attrib, int value)

Sets a render-to-texture attribute.

Inherited from org.lwjgl.opengl.DrawableGL:
checkDestroyedcheckGLErrorcreateSharedContextdestroygetContextgetPixelFormatinitContextisCurrentmakeCurrentreleaseContextsetCLSharingPropertiessetPixelFormatsetPixelFormatsetSwapIntervalswapBuffers

Field Detail

BACK_LEFT_BUFFERback to summary
public static final int BACK_LEFT_BUFFER

The Pbuffer back left buffer.

BACK_RIGHT_BUFFERback to summary
public static final int BACK_RIGHT_BUFFER

The Pbuffer back right buffer.

CUBE_MAP_FACEback to summary
public static final int CUBE_MAP_FACE

The render-to-texture cube map face attribute.

DEPTH_BUFFERback to summary
public static final int DEPTH_BUFFER

The Pbuffer depth buffer.

FRONT_LEFT_BUFFERback to summary
public static final int FRONT_LEFT_BUFFER

The Pbuffer front left buffer.

FRONT_RIGHT_BUFFERback to summary
public static final int FRONT_RIGHT_BUFFER

The Pbuffer front right buffer.

heightback to summary
private final int height

Height

MIPMAP_LEVELback to summary
public static final int MIPMAP_LEVEL

The render-to-texture mipmap level attribute.

PBUFFER_SUPPORTEDback to summary
public static final int PBUFFER_SUPPORTED

Indicates that Pbuffers can be created.

RENDER_DEPTH_TEXTURE_SUPPORTEDback to summary
public static final int RENDER_DEPTH_TEXTURE_SUPPORTED

Indicates that Pbuffers can be used as depth render-textures.

RENDER_TEXTURE_RECTANGLE_SUPPORTEDback to summary
public static final int RENDER_TEXTURE_RECTANGLE_SUPPORTED

Indicates that Pbuffers can be used as non-power-of-two render-textures.

RENDER_TEXTURE_SUPPORTEDback to summary
public static final int RENDER_TEXTURE_SUPPORTED

Indicates that Pbuffers can be used as render-textures.

TEXTURE_CUBE_MAP_NEGATIVE_Xback to summary
public static final int TEXTURE_CUBE_MAP_NEGATIVE_X

The render-to-texture cube map negative X face value.

TEXTURE_CUBE_MAP_NEGATIVE_Yback to summary
public static final int TEXTURE_CUBE_MAP_NEGATIVE_Y

The render-to-texture cube map negative Y face value.

TEXTURE_CUBE_MAP_NEGATIVE_Zback to summary
public static final int TEXTURE_CUBE_MAP_NEGATIVE_Z

The render-to-texture cube map negative Z face value.

TEXTURE_CUBE_MAP_POSITIVE_Xback to summary
public static final int TEXTURE_CUBE_MAP_POSITIVE_X

The render-to-texture cube map positive X face value.

TEXTURE_CUBE_MAP_POSITIVE_Yback to summary
public static final int TEXTURE_CUBE_MAP_POSITIVE_Y

The render-to-texture cube map positive Y face value.

TEXTURE_CUBE_MAP_POSITIVE_Zback to summary
public static final int TEXTURE_CUBE_MAP_POSITIVE_Z

The render-to-texture cube map positive Z face value.

widthback to summary
private final int width

Width

Constructor Detail

Pbufferback to summary
public Pbuffer(int width, int height, PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException

Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.

Note

The Pbuffer will have its own context that shares display lists and textures with shared_context, or, if shared_context is null, the Display context if it is created. The Pbuffer will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.

Parameters
width:int

Pbuffer width

height:int

Pbuffer height

pixel_format:PixelFormat

Minimum Pbuffer context properties

shared_drawable:Drawable

If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share with the Display context (if created).

Pbufferback to summary
public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable) throws LWJGLException

Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.

Note

The Pbuffer will have its own context that shares display lists and textures with shared_context, or, if shared_context is null, the Display context if it is created. The Pbuffer will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.

The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null, render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that it is supported. Currently only windows platform can support this feature, so it is recommended that EXT_framebuffer_object or similar is used if available, for maximum portability.

Parameters
width:int

Pbuffer width

height:int

Pbuffer height

pixel_format:PixelFormat

Minimum Pbuffer context properties

shared_drawable:Drawable

If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share with the Display context (if created).

Pbufferback to summary
public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable, ContextAttribs attribs) throws LWJGLException

Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.

Note

The Pbuffer will have its own context that shares display lists and textures with shared_context, or, if shared_context is null, the Display context if it is created. The Pbuffer will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.

The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null, render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that it is supported. Currently only windows platform can support this feature, so it is recommended that EXT_framebuffer_object or similar is used if available, for maximum portability.

Parameters
width:int

Pbuffer width

height:int

Pbuffer height

pixel_format:PixelFormat

Minimum Pbuffer context properties

shared_drawable:Drawable

If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share with the Display context (if created).

attribs:ContextAttribs

The ContextAttribs to use when creating the context. (optional, may be null)

Method Detail

bindTexImageback to summary
public synchronized void bindTexImage(int buffer)

Binds the currently bound texture to the buffer specified. The buffer can be one of the following:

FRONT_LEFT_BUFFER FRONT_RIGHT_BUFFER BACK_LEFT_BUFFER BACK_RIGHT_BUFFER DEPTH_BUFFER

createPbufferback to summary
private static PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, ContextAttribs attribs, RenderTexture renderTexture) throws LWJGLException
getCapabilitiesback to summary
public static int getCapabilities()

Gets the Pbuffer capabilities.

Returns:int

a bitmask of Pbuffer capabilities.

getHeightback to summary
public synchronized int getHeight()
Returns:int

Returns the height.

getWidthback to summary
public synchronized int getWidth()
Returns:int

Returns the width.

isBufferLostback to summary
public synchronized boolean isBufferLost()

Method to test for validity of the buffer. If this function returns true, the buffer contents is lost. The buffer can still be used, but the results are undefined. The application is expected to release the buffer if needed, destroy it and recreate a new buffer.

Returns:boolean

true if the buffer is lost and destroyed, false if the buffer is valid.

releaseTexImageback to summary
public synchronized void releaseTexImage(int buffer)

Releases the currently bound texture from the buffer specified.

setAttribback to summary
public synchronized void setAttrib(int attrib, int value)

Sets a render-to-texture attribute.

The attrib parameter can be one of MIPMAP_LEVEL and CUBE_MAP_FACE. When the attrib parameter is CUBE_MAP_FACE then the value parameter can be on of the following:

TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z