I’m trying to open a new window, but makeOutput() always return none. Strangely, even when I use self.makeWindow(props=wp), with any wp=WindowProperties(), it only returns none.
# set new window properties
wp = WindowProperties()
# get default frame buffer properties
fb_prop = FrameBufferProperties.getDefault()
# create graphics output
self.bowl_win = self.graphicsEngine.makeOutput(self.pipe,"bowl_win",0,fb_prop, wp,
What doesn’t work?
makeWindow() without setting anything works.
I don’t speak from experience, but the following post suggests that it might be worth changing your provided framebuffer-properties:
fbprops = FrameBufferProperties(FrameBufferProperties.get_default())
Don’t do this. Create an empty FrameBufferProperties, and only override the properties you need. FilterManager already takes care of the defaults for you.
Incidentally, FilterManager also automatically sets the appropriate aux bits in FrameBufferProperties if you pass in an aux texture.
The reason it doesn’t work is likely because the default FrameBufferProperties include a request for back buffers. Offscreen buffers do…
creating an empty fb_prop = FrameBufferProperties() didn’t help unfortunatelty,
And I also don’t understand why self.makeWindow(prop=WindowProperties()) doesn’t work
What’s the message in the console?
So if I try to create a display region for the new “window” I get
AttributeError: 'NoneType' object has no attribute 'makeDisplayRegion'
Do you get any errors or messages before that point?
Ah, after a experimenting a little on my side, I found that–on my machine at least–the WindowProperties object seems to be the culprit.
Specifically, if, instead of a blank WindowProperies object with only the origin specified, I used either the default WindowProperties or a copy of the main window’s properties, I got a functional window from “makeOutput”.
I’d guess then that there’s some setting or group of settings in WindowProperties that’s required for this to work.
Ah! Thanks! In my case I want to open a second window that has an origin different from the main window
It’s my pleasure!
As to having a different origin, there is I think nothing to stop you from copying the WindowProperties of the main window, then altering the position-setting in the copy.
If I remember correctly, the size in
WindowProperies must be specified.