I split the screen by creating another display region:
dr1 = cam.node().getDisplayRegion(0)
dr2 = base.win.makeDisplayRegion(0.1, 0.4, 0.2, 0.6)
dr.setDimensions(0, 0.5, 0, 1)
dr2.setDimensions(0.5, 1, 0, 1)
# then restore it later
base.win.removeDisplayRegion(dr2)
dr1.setDimensions(0, 1, 0, 1)
The restoration code seems not working very well. The window after restoration has a wrong aspect ratio, it becomes double wide. What is the proper way to do a restoring here ?
That should do it (except for the strange reference to “dr” instead of “dr1” in the second line). There must be something else changing your aspect ratio. This is a property of base.camLens, and is normally adjusted automatically by Panda when your window is resized by the user.
You’re fiddling with the aspect ratio of the camera to compensate for the new, skinny DisplayRegion. When you make the DisplayRegion wide again, you’ll have to fiddle it back.