Package org.lwjgl.opengl
Class WGLARBRenderTexture
- java.lang.Object
-
- org.lwjgl.opengl.WGLARBRenderTexture
-
public class WGLARBRenderTexture extends java.lang.Object
Native bindings to the WGL_ARB_render_texture extension.This extension allows a color buffer to be used for both rendering and texturing. When a color buffer is bound to a texture target it cannot be rendered to. Once it has been released from the texture it can be rendered to once again.
This extension may provide a performance boost and reduce memory requirements on architectures that support rendering to the same memory where textures reside and in the same memory format and layout required by texturing. The functionality is similar to CopyTexImage1D and CopyTexImage2D. However, some changes were made to make it easier to avoid copying data:
- Only color buffers of a pbuffer can be bound as a texture. It is not possible to use the color buffer of a window as a texture.
- The texture internal format is determined when the color buffer is associated with the texture, guaranteeing that the color buffer format is equivalent to the texture internal format.
- When a color buffer of a pbuffer is being used as a texture, the pbuffer can not be used for rendering; this makes it easier for implementations to avoid a copy of the image since the semantics of the pointer swap are clear.
- The application must release the color buffer from the texture before it can render to the pbuffer again. When the color buffer is bound as a texture, draw and read operations on the pbuffer are undefined.
- A mipmap attribute can be set, in which case memory will be allocated up front for mipmaps. The application can render the mipmap images or, if SGIS_generate_mipmap is supported, they can be automatically generated when the color buffer is bound as a texture.
- A texture target is associated with the pbuffer, so that cubemap images can be rendered into a single color buffer.
Requires
WGL_ARB_extensions_string
,WGL_ARB_pixel_format
,WGL_ARB_pbuffer
.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
WGL_AUX0_ARB
WGL_AUX1_ARB
WGL_AUX2_ARB
WGL_AUX3_ARB
WGL_AUX4_ARB
WGL_AUX5_ARB
WGL_AUX6_ARB
WGL_AUX7_ARB
WGL_AUX8_ARB
WGL_AUX9_ARB
WGL_BACK_LEFT_ARB
WGL_BACK_RIGHT_ARBstatic int
WGL_BIND_TO_TEXTURE_RGB_ARB
WGL_BIND_TO_TEXTURE_RGBA_ARBAccepted by theattributes
parameter ofGetPixelFormatAttribivARB
, and theattribIList
parameters ofChoosePixelFormatARB
.static int
WGL_CUBE_MAP_FACE_ARB
Accepted by theattribList
parameter ofSetPbufferAttribARB
and by theattribute
parameter ofQueryPbufferARB
.static int
WGL_FRONT_LEFT_ARB
WGL_FRONT_RIGHT_ARBstatic int
WGL_MIPMAP_LEVEL_ARB
Accepted by theattribList
parameter ofSetPbufferAttribARB
and by theattribute
parameter ofQueryPbufferARB
.static int
WGL_MIPMAP_TEXTURE_ARB
Accepted by theattribList
parameter ofCreatePbufferARB
and by theattribute
parameter ofQueryPbufferARB
.static int
WGL_NO_TEXTURE_ARB
Accepted as a value in theattribList
parameter ofCreatePbufferARB
and returned in the value parameter ofQueryPbufferARB
whenattribute
isTEXTURE_FORMAT_ARB
.static int
WGL_TEXTURE_1D_ARB
WGL_TEXTURE_2D_ARB
WGL_TEXTURE_CUBE_MAP_ARBAccepted as a value in theattribList
parameter ofCreatePbufferARB
and returned in the value parameter ofQueryPbufferARB
whenattribute
isTEXTURE_TARGET_ARB
.static int
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARBAccepted as a value in theattribList
parameter ofSetPbufferAttribARB
and returned in the value parameter ofQueryPbufferARB
whenattribute
isCUBE_MAP_FACE_ARB
.static int
WGL_TEXTURE_FORMAT_ARB
Accepted by theattribList
parameter ofCreatePbufferARB
and by theattribute
parameter ofQueryPbufferARB
.static int
WGL_TEXTURE_RGB_ARB
WGL_TEXTURE_RGBA_ARBAccepted as a value in theattribList
parameter ofCreatePbufferARB
and returned in the value parameter ofQueryPbufferARB
whenattribute
isTEXTURE_FORMAT_ARB
.static int
WGL_TEXTURE_TARGET_ARB
Accepted by theattribList
parameter ofCreatePbufferARB
and by theattribute
parameter ofQueryPbufferARB
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static boolean
wglBindTexImageARB(long pbuffer, int buffer)
Defines a one-dimensional texture image or two-dimensional texture image or a set of two-dimensional cube map texture images.static boolean
wglReleaseTexImageARB(long pbuffer, int buffer)
Releases the specified color buffer back to the pbuffer.static boolean
wglSetPbufferAttribARB(long pbuffer, int[] attribList)
Array version of:SetPbufferAttribARB
static boolean
wglSetPbufferAttribARB(long pbuffer, java.nio.IntBuffer attribList)
Sets an attribute to the specified pbuffer.
-
-
-
Field Detail
-
WGL_BIND_TO_TEXTURE_RGB_ARB, WGL_BIND_TO_TEXTURE_RGBA_ARB
Accepted by theattributes
parameter ofGetPixelFormatAttribivARB
, and theattribIList
parameters ofChoosePixelFormatARB
.
-
WGL_TEXTURE_FORMAT_ARB, WGL_TEXTURE_TARGET_ARB, WGL_MIPMAP_TEXTURE_ARB
Accepted by theattribList
parameter ofCreatePbufferARB
and by theattribute
parameter ofQueryPbufferARB
.
-
WGL_TEXTURE_RGB_ARB, WGL_TEXTURE_RGBA_ARB, WGL_NO_TEXTURE_ARB
Accepted as a value in theattribList
parameter ofCreatePbufferARB
and returned in the value parameter ofQueryPbufferARB
whenattribute
isTEXTURE_FORMAT_ARB
.
-
WGL_TEXTURE_CUBE_MAP_ARB, WGL_TEXTURE_1D_ARB, WGL_TEXTURE_2D_ARB
Accepted as a value in theattribList
parameter ofCreatePbufferARB
and returned in the value parameter ofQueryPbufferARB
whenattribute
isTEXTURE_TARGET_ARB
.
-
WGL_MIPMAP_LEVEL_ARB, WGL_CUBE_MAP_FACE_ARB
Accepted by theattribList
parameter ofSetPbufferAttribARB
and by theattribute
parameter ofQueryPbufferARB
.
-
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
Accepted as a value in theattribList
parameter ofSetPbufferAttribARB
and returned in the value parameter ofQueryPbufferARB
whenattribute
isCUBE_MAP_FACE_ARB
.
-
-
Method Detail
-
wglBindTexImageARB
public static boolean wglBindTexImageARB(long pbuffer, int buffer)
Defines a one-dimensional texture image or two-dimensional texture image or a set of two-dimensional cube map texture images. The texture image or images consist of the image data inbuffer
for the specifiedpbuffer
and need not be copied. The texture target, the texture format and the size of the texture components are derived from attributes of pbuffer specified bypbuffer
.- Parameters:
pbuffer
- a pbuffer handlebuffer
- the target buffer. One of:FRONT_LEFT_ARB
FRONT_RIGHT_ARB
BACK_LEFT_ARB
BACK_RIGHT_ARB
AUX0_ARB
WGL_AUX[1-9]_ARB
-
wglReleaseTexImageARB
public static boolean wglReleaseTexImageARB(long pbuffer, int buffer)
Releases the specified color buffer back to the pbuffer. The pbuffer is made available for reading and writing when it no longer has any color buffers bound as textures.- Parameters:
pbuffer
- a pbuffer handlebuffer
- the target buffer. One of:FRONT_LEFT_ARB
FRONT_RIGHT_ARB
BACK_LEFT_ARB
BACK_RIGHT_ARB
AUX0_ARB
WGL_AUX[1-9]_ARB
-
wglSetPbufferAttribARB
public static boolean wglSetPbufferAttribARB(long pbuffer, java.nio.IntBuffer attribList)
Sets an attribute to the specified pbuffer.- Parameters:
pbuffer
- a pbuffer handleattribList
- a 0-terminated list of attribute {type, value} pairs containing integer values
-
wglSetPbufferAttribARB
public static boolean wglSetPbufferAttribARB(long pbuffer, int[] attribList)
Array version of:SetPbufferAttribARB
-
-