Click or drag to resize

FramebufferAttachTexture Method

Attach a texture to this framebuffer.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public void AttachTexture(
	FramebufferAttachment attachment,
	Texture texture,
	int cubeTarget = 0
)

Parameters

attachment
Type: OooglesFramebufferAttachment
the attachment point to which texture should be attached.
texture
Type: OooglesTexture
the texture to attach.
cubeTarget (Optional)
Type: SystemInt32
(optional) if this texture is a cube texture, then this parameter specifies which of the 6 cube faces to attach. This parameter is ignored for 2D textures.
Exceptions
ExceptionCondition
GLExceptionInvalidOperation if no framebuffer is bound.
Remarks
This method attaches the texture image specified by texture as one of the logical buffers of the currently bound framebuffer object. attachment specifies whether the texture image should be attached to the framebuffer object's color, depth, or stencil buffer. A texture image may not be attached to the default framebuffer object name 0.

Note: special precautions need to be taken to avoid attaching a texture image to the currently bound framebuffer while the texture object is currently bound and potentially sampled by the current vertex or fragment shader. Doing so could lead to the creation of a "feedback loop" between the writing of pixels by rendering operations and the simultaneous reading of those same pixels when used as texels in the currently bound texture. In this scenario, the framebuffer will be considered framebuffer complete, but the values of fragments rendered while in this state will be undefined. The values of texture samples may be undefined as well.

Note: if a texture object is deleted while its image is attached to the currently bound framebuffer, then it is as if DetachTexture(FramebufferAttachment) had been called for the attachment point to which this image was attached in the currently bound framebuffer object. In other words, the texture image is detached from the currently bound framebuffer. Note that the texture image is specifically not detached from any non-bound framebuffers. Detaching the image from any non-bound framebuffers is the responsibility of the application.

Note: in DEBUG mode with assertions enabled, an error will be logged to the debug console if this framebuffer is not bound.

OpenGL API: glFramebufferTexture2D

See Also

Reference