Fullscreen causes Black Screen

Greetings everyone, I scaled the default 640x800 resolution of panda window to my monitor native 1366x768 and turned fullscreen on from within the script. I haven’t loaded models or anything so the screen remains black. Everything works fine but when I close the window, my monitor goes black and whatever refresh or anything I do, it won’t become visible again. I even somehow managed to Sign-out and re-Sign-in into the System but it wouldn’t help.

To rectify this I’ll have to reboot my system so as to get my display back. What is the problem happening here ?
Info : My Drivers are all up to date.

Edit : The display comes back after signing out but goes again after singning in.

Post the entire sample code, I’m interested in how you close the window.

Code:

from panda3d.core import *
from direct. showbase. ShowBase import ShowBase
loadPrcFileData("", "win-size 1366 768")
loadPrcFileData("", "fullscreen 1")

base = ShowBase()
base.run()

I close it with Alt+F4
I got that it gains back diplay after closing the Shell but stays black if shell is not closed.

You have not specified which operating system you are using and which version of Panda3D.

I’m using Windows 10 64-bit version 1909 and Panda3D v.1.10.6

Hmm, I have a similar configuration, except that I have a monoblock. Once this happened, the weirdest thing was that it was a one-time thing and not related to full-screen mode.

Then what else could be causing the problem ?

If this happens every time, you need to experiment.

  1. For example, don’t turn on the full screen.
  2. try sys.exit()
import sys

base.accept('e', sys.exit)
  1. Try changing the message level in the console.

We need to find out exactly what leads to this.

Well Sir, ‘base’ turns out to be ‘not defined’, don’t know why,
but I removed the fullscreen-ing line of code from my script and the problem vanished.
Since, there isn’t much difference as far as I see in a fullscreen window and a window opened in a monitor’s native full resolution, so I’d better be running at full resolution rather than on fullscreen.
Thanks for your help.

Your code should be between these lines.

base = ShowBase()

# Your code

base.run()
from panda3d.core import *
from direct. showbase. ShowBase import ShowBase
loadPrcFileData("", "win-size 1366 768")
loadPrcFileData("", "fullscreen 1")
import sys

base = ShowBase()

base.accept('e', sys.exit)

base.run()

I meant additional information will be useful to solve this problem for others.