public final class Pbuffer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BACK_LEFT_BUFFER
The Pbuffer back left buffer.
|
static int |
BACK_RIGHT_BUFFER
The Pbuffer back right buffer.
|
protected org.lwjgl.opengl.ContextGL |
context
The OpenGL Context.
|
static int |
CUBE_MAP_FACE
The render-to-texture cube map face attribute.
|
static int |
DEPTH_BUFFER
The Pbuffer depth buffer.
|
static int |
FRONT_LEFT_BUFFER
The Pbuffer front left buffer.
|
static int |
FRONT_RIGHT_BUFFER
The Pbuffer front right buffer.
|
static int |
MIPMAP_LEVEL
The render-to-texture mipmap level attribute.
|
static int |
PBUFFER_SUPPORTED
Indicates that Pbuffers can be created.
|
protected org.lwjgl.opengl.PeerInfo |
peer_info
Handle to the native GL rendering context
|
protected PixelFormat |
pixel_format
The PixelFormat used to create the drawable.
|
static int |
RENDER_DEPTH_TEXTURE_SUPPORTED
Indicates that Pbuffers can be used as depth render-textures.
|
static int |
RENDER_TEXTURE_RECTANGLE_SUPPORTED
Indicates that Pbuffers can be used as non-power-of-two render-textures.
|
static int |
RENDER_TEXTURE_SUPPORTED
Indicates that Pbuffers can be used as render-textures.
|
static int |
TEXTURE_CUBE_MAP_NEGATIVE_X
The render-to-texture cube map negative X face value.
|
static int |
TEXTURE_CUBE_MAP_NEGATIVE_Y
The render-to-texture cube map negative Y face value.
|
static int |
TEXTURE_CUBE_MAP_NEGATIVE_Z
The render-to-texture cube map negative Z face value.
|
static int |
TEXTURE_CUBE_MAP_POSITIVE_X
The render-to-texture cube map positive X face value.
|
static int |
TEXTURE_CUBE_MAP_POSITIVE_Y
The render-to-texture cube map positive Y face value.
|
static int |
TEXTURE_CUBE_MAP_POSITIVE_Z
The render-to-texture cube map positive Z face value.
|
Constructor and Description |
---|
Pbuffer(int width,
int height,
PixelFormat pixel_format,
Drawable shared_drawable)
Create an instance of a Pbuffer with a unique OpenGL context.
|
Pbuffer(int width,
int height,
PixelFormat pixel_format,
RenderTexture renderTexture,
Drawable shared_drawable)
Create an instance of a Pbuffer with a unique OpenGL context.
|
Pbuffer(int width,
int height,
PixelFormat pixel_format,
RenderTexture renderTexture,
Drawable shared_drawable,
ContextAttribs attribs)
Create an instance of a Pbuffer with a unique OpenGL context.
|
Modifier and Type | Method and Description |
---|---|
void |
bindTexImage(int buffer)
Binds the currently bound texture to the buffer specified.
|
protected void |
checkDestroyed() |
void |
checkGLError() |
org.lwjgl.opengl.ContextGL |
createSharedContext()
[INTERNAL USE ONLY] Creates a new Context that is shared with the Drawable's Context.
|
void |
destroy()
Destroys the Drawable.
|
static int |
getCapabilities()
Gets the Pbuffer capabilities.
|
org.lwjgl.opengl.ContextGL |
getContext()
[INTERNAL USE ONLY] Returns the Drawable's Context.
|
int |
getHeight() |
PixelFormatLWJGL |
getPixelFormat() |
int |
getWidth() |
void |
initContext(float r,
float g,
float b) |
boolean |
isBufferLost()
Method to test for validity of the buffer.
|
boolean |
isCurrent()
Returns true if the Drawable's context is current in the current thread.
|
void |
makeCurrent()
Makes the Drawable's context current in the current thread.
|
void |
releaseContext()
If the Drawable's context is current in the current thread, no context will be current after a call to this method.
|
void |
releaseTexImage(int buffer)
Releases the currently bound texture from the buffer specified.
|
void |
setAttrib(int attrib,
int value)
Sets a render-to-texture attribute.
|
void |
setCLSharingProperties(PointerBuffer properties)
Sets the appropriate khr_gl_sharing properties in the target
PointerBuffer ,
so that if it is used in a clCreateContext(FromType) call, the created CL
context will be sharing objects with this Drawable 's GL context. |
void |
setPixelFormat(PixelFormatLWJGL pf) |
void |
setPixelFormat(PixelFormatLWJGL pf,
ContextAttribs attribs) |
void |
setSwapInterval(int swap_interval) |
void |
swapBuffers() |
public static final int PBUFFER_SUPPORTED
public static final int RENDER_TEXTURE_SUPPORTED
public static final int RENDER_TEXTURE_RECTANGLE_SUPPORTED
public static final int RENDER_DEPTH_TEXTURE_SUPPORTED
public static final int MIPMAP_LEVEL
public static final int CUBE_MAP_FACE
public static final int TEXTURE_CUBE_MAP_POSITIVE_X
public static final int TEXTURE_CUBE_MAP_NEGATIVE_X
public static final int TEXTURE_CUBE_MAP_POSITIVE_Y
public static final int TEXTURE_CUBE_MAP_NEGATIVE_Y
public static final int TEXTURE_CUBE_MAP_POSITIVE_Z
public static final int TEXTURE_CUBE_MAP_NEGATIVE_Z
public static final int FRONT_LEFT_BUFFER
public static final int FRONT_RIGHT_BUFFER
public static final int BACK_LEFT_BUFFER
public static final int BACK_RIGHT_BUFFER
public static final int DEPTH_BUFFER
protected PixelFormat pixel_format
protected org.lwjgl.opengl.PeerInfo peer_info
protected org.lwjgl.opengl.ContextGL context
public Pbuffer(int width, int height, PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException
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.
width
- Pbuffer widthheight
- Pbuffer heightpixel_format
- Minimum Pbuffer context propertiesshared_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).LWJGLException
public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable) throws LWJGLException
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.
width
- Pbuffer widthheight
- Pbuffer heightpixel_format
- Minimum Pbuffer context propertiesrenderTexture
- shared_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).LWJGLException
public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable, ContextAttribs attribs) throws LWJGLException
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.
width
- Pbuffer widthheight
- Pbuffer heightpixel_format
- Minimum Pbuffer context propertiesrenderTexture
- shared_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
- The ContextAttribs to use when creating the context. (optional, may be null)LWJGLException
public boolean isBufferLost()
public static int getCapabilities()
public void setAttrib(int attrib, int value)
attrib
- value
- public void bindTexImage(int buffer)
buffer
- public void releaseTexImage(int buffer)
buffer
- public int getHeight()
public int getWidth()
public void setPixelFormat(PixelFormatLWJGL pf) throws LWJGLException
LWJGLException
public void setPixelFormat(PixelFormatLWJGL pf, ContextAttribs attribs) throws LWJGLException
LWJGLException
public PixelFormatLWJGL getPixelFormat()
public org.lwjgl.opengl.ContextGL getContext()
public org.lwjgl.opengl.ContextGL createSharedContext() throws LWJGLException
LWJGLException
public void checkGLError()
public void setSwapInterval(int swap_interval)
public void swapBuffers() throws LWJGLException
LWJGLException
public void initContext(float r, float g, float b)
public boolean isCurrent() throws LWJGLException
Drawable
LWJGLException
public void makeCurrent() throws LWJGLException
Drawable
LWJGLException
public void releaseContext() throws LWJGLException
Drawable
LWJGLException
public void destroy()
Drawable
public void setCLSharingProperties(PointerBuffer properties) throws LWJGLException
Drawable
PointerBuffer
,
so that if it is used in a clCreateContext(FromType)
call, the created CL
context will be sharing objects with this Drawable
's GL context. After a
call to this method, the target buffer position will have advanced by 2 to 4 positions,
depending on the implementation.properties
- The target properties buffer. It must have at least 4 positions remaining.LWJGLException
protected final void checkDestroyed()
Copyright © 2002-2009 lwjgl.org. All Rights Reserved.