Contents
- Dependencies
- Overview
- New Procedures and Functions
- New Tokens
- New State
Dependencies
OpenGL 1.1 is required.
WGL_ARB_extensions_string is required.
WGL_ARB_pixel_format is required.
WGL_ARB_pbuffer is required.
WGL_ARB_make_current_read affects the definition of this extension.
GL_ARB_texture_cube_map affects the definition of this extension
The extension is written against the OpenGL 1.2.1 Specification.
Overview
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 GL_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.
Note that this extension may be used in conjunction with other extensions to associate video images/buffers to pbuffers. Once the video image is associated with a pbuffer it can be used as a texture. Also, if GL_SGIX_generate_mipmap is supported, it is possible to create a complete set of mipmap images from a single color buffer.
New Procedures and Functions
``` BOOL wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer)
BOOL wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer)
BOOL wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList) ```
New Tokens
Accepted by the
<piAttributes>
parameter of wglGetPixelFormatAttribivARB, wglGetPixelFormatAttribfvARB, and the
<piAttribIList>
and
<pfAttribIList>
parameters of wglChoosePixelFormatARB:
|WGL_BIND_TO_TEXTURE_RGB_ARB | 0x2070| |:------------------------------------|:---------| |WGL_BIND_TO_TEXTURE_RGBA_ARB | 0x2071|
Accepted by the
<piAttribList>
parameter of wglCreatePbufferARB and by the
<iAttribute>
parameter of wglQueryPbufferARB:
|WGL_TEXTURE_FORMAT_ARB | 0x2072| |:-----------------------------|:--------------| |WGL_TEXTURE_TARGET_ARB | 0x2073| |WGL_MIPMAP_TEXTURE_ARB | 0x2074|
Accepted as a value in the
<piAttribList>
parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when
<iAttribute>
is WGL_TEXTURE_FORMAT_ARB:
|WGL_TEXTURE_RGB_ARB | 0x2075| |:------------------------------|:-------------| |WGL_TEXTURE_RGBA_ARB | 0x2076| |WGL_NO_TEXTURE_ARB | 0x2077|
Accepted as a value in the
<piAttribList>
parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when
<iAttribute>
is WGL_TEXTURE_TARGET_ARB:
|WGL_TEXTURE_CUBE_MAP_ARB | 0x2078| |:------------------------------|:--------------| |WGL_TEXTURE_1D_ARB | 0x2079| |WGL_TEXTURE_2D_ARB | 0x207A| |WGL_NO_TEXTURE_ARB | 0x2077|
Accepted by the
<piAttribList>
parameter of wglSetPbufferAttribARB and by the
<iAttribute>
parameter of wglQueryPbufferARB:
|WGL_MIPMAP_LEVEL_ARB | 0x207B| |:--------------------------------|:-----------| |WGL_CUBE_MAP_FACE_ARB | 0x207C|
Accepted as a value in the
<piAttribList>
parameter of wglSetPbufferAttribARB and returned in the value parameter of wglQueryPbufferARB when
<iAttribute>
is WGL_CUBE_MAP_FACE_ARB:
|WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB | 0x207D| |:-------------------------------------------|:-------| |WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB | 0x207E| |WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB | 0x207F| |WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB | 0x2080 | |WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB | 0x2081| |WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB | 0x2082|
Accepted by the
<iBuffer>
parameter of wglBindTexImageARB and wglReleaseTexImageARB:
|WGL_FRONT_LEFT_ARB |0x2083| |:--------------------------------------|:-----| |WGL_FRONT_RIGHT_ARB |0x2084| |WGL_BACK_LEFT_ARB |0x2085| |WGL_BACK_RIGHT_ARB |0x2086| |WGL_AUX0_ARB |0x2087| |WGL_AUX1_ARB |0x2088| |WGL_AUX2_ARB |0x2089| |WGL_AUX3_ARB |0x208A| |WGL_AUX4_ARB |0x208B| |WGL_AUX5_ARB |0x208C| |WGL_AUX6_ARB |0x208D| |WGL_AUX7_ARB |0x208E| |WGL_AUX8_ARB |0x208F| |WGL_AUX9_ARB |0x2090|
New State
None