MCPcopy Create free account
hub / github.com/cginternals/globjects / detach

Method detach

source/globjects/source/Framebuffer.cpp:130–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool Framebuffer::detach(const GLenum attachment)
131{
132 FramebufferAttachment * attachmentObject = getAttachment(attachment);
133
134 if (!attachmentObject)
135 return false;
136
137 if (attachmentObject->isTextureAttachment())
138 {
139 AttachedTexture * textureAttachment = attachmentObject->asTextureAttachment();
140
141 if (textureAttachment->hasLayer())
142 {
143 implementation().attachTextureLayer(this, attachment, nullptr, textureAttachment->level(), textureAttachment->layer());
144 }
145 else
146 {
147 implementation().attachTexture(this, attachment, nullptr, textureAttachment->level());
148 }
149 }
150 else if (attachmentObject->isRenderBufferAttachment())
151 {
152 implementation().attachRenderBuffer(this, attachment, nullptr);
153 }
154
155 m_attachments.erase(attachment);
156
157 return true;
158}
159
160void Framebuffer::setReadBuffer(const GLenum mode) const
161{

Callers

nothing calls this directly

Calls 9

asTextureAttachmentMethod · 0.80
hasLayerMethod · 0.80
layerMethod · 0.80
isTextureAttachmentMethod · 0.45
attachTextureLayerMethod · 0.45
levelMethod · 0.45
attachTextureMethod · 0.45
attachRenderBufferMethod · 0.45

Tested by

no test coverage detected