Use non-window fbo in scene.get_image

This commit is contained in:
Grant Sanderson 2023-01-26 20:02:50 -08:00
parent 3a175c1a4c
commit 9ee9e1946a

View file

@ -288,13 +288,12 @@ class Scene(object):
def get_image(self) -> Image: def get_image(self) -> Image:
if self.window is not None: if self.window is not None:
self.window.size = self.camera.get_pixel_shape() self.camera.use_window_fbo(False)
self.window.swap_buffers() self.camera.clear()
self.update_frame() self.camera.capture(*self.mobjects)
self.window.swap_buffers()
image = self.camera.get_image() image = self.camera.get_image()
if self.window is not None: if self.window is not None:
self.window.to_default_position() self.camera.use_window_fbo(True)
return image return image
def show(self) -> None: def show(self) -> None: