How to resize the ShowBase offscreen buffer?

I want to resize the ShowBase offscreen buffer, if ShowBase has been initialized with offscreen flag. Onscreen mode seems to be no problem with

wp = WindowProperties()
wp.setSize(width, height)

But i have no luck doing something similar in offscreen mode. Any advice?

Hi again,
i arrived now at this solution, which seems to work - but i’am sure there is a better way to do it:

if isinstance(, GraphicsWindow):
            wp =
            wp.setSize(width, height)
            if width != or height !=
                #try to reopen main window
                wp = WindowProperties.getDefault()
                wp.setSize(width, height)
                fbprops =
                pipe =
                self.renderer.openMainWindow(keepCamera =True, type="offscreen", props=wp, pipe=pipe, fbprops = fbprops)

You can’t resize the offscreen buffer made via the ShowBase offscreen window type. What I suggest doing is creating a resizeable buffer (with the BF_resizeable flag) with the main offscreen buffer as host, and then doing all your rendering using that resizeable buffer.

Reopening the buffer works too, but it may be a bit messier.