MCPcopy Index your code
hub / github.com/XingangPan/DragGAN / bind

Method bind

gui_utils/gl_utils.py:291–299  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

289
290 @contextlib.contextmanager
291 def bind(self):
292 prev_fbo = gl.glGetInteger(gl.GL_FRAMEBUFFER_BINDING)
293 prev_rbo = gl.glGetInteger(gl.GL_RENDERBUFFER_BINDING)
294 gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, self.gl_id)
295 if self.width is not None and self.height is not None:
296 gl.glViewport(0, 0, self.width, self.height)
297 yield
298 gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, prev_fbo)
299 gl.glBindRenderbuffer(gl.GL_RENDERBUFFER, prev_rbo)
300
301 def blit(self, dst=None):
302 assert dst is None or isinstance(dst, Framebuffer)

Callers 2

__init__Method · 0.95
blitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected