How to resize the ShowBase offscreen buffer?

Hi,
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)
self.win.requestProperties(wp)

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

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(self.renderer.win, GraphicsWindow):
            wp = self.renderer.win.getProperties()
            wp.setSize(width, height)
            self.renderer.win.requestProperties(wp)
            
        else:
            if width != self.renderer.win.getXSize() or height != self.renderer.win.getYSize():
                #try to reopen main window
                wp = WindowProperties.getDefault()
                wp.setSize(width, height)
                fbprops = self.renderer.win.getFbProperties()
                pipe = self.renderer.win.getPipe()
                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.