setting fullscreen.

in the root game directory i have the config.prc configuration file, inside it just have a line saying :

fullscreen #t

in the module i have imported the loadPrcFile from pandac.PandaModules

then loaded it with the line:


but when i run the module nothing occur, yet with windows screen…
what could be?

Are you sure you put that call before your DirectStart import?

I tried like this :

from direct.showbase.DirectObject import DirectObject
from direct.interval.IntervalGlobal import *
from pandac.PandaModules import loadPrcFile, WindowProperties
from menu import MainMenu


import direct.directbase.DirectStart

class Main(DirectObject):

Try doing it before you have imported anything else, other than PandaModules. Who knows whether some of these other module might implicitly import DirectStart for you?

Also check the return value of loadPrcFile(), make sure it returns non-None. If it fails to load the config file, it will return None. (It will also print an error message, but maybe it did and you didn’t notice it.)


could not get though the config.prc file, but i changed in the config.prc located in panda3d/etc directory the line fullscreen #f to true and now works, with that is enough because window mode is not good for that i´m looking for to do…


What about if you set it within your code?


wp = WindowProperties() 

Unfortunately, you can’t change an existing window to fullscreen that way; you have to create it with the fullscreen property enabled from the beginning. This is possible to do with Python code, but it’s usually easier just to set the fullscreen config variable.


Really? I have no problem running my code like that. it launches in a windowed mode, then resizes itself.

in fact, I just wrote a function this morning:

def gameWin(self):
		# get the aspect ratio
		aspectr = base.getAspectRatio()
		# load all window properties into a var
		wp = WindowProperties()
		# set the size of the window
		# comment this, and uncomment the line after
		# to set to full screen
		wp.setSize(1024, 768)
		# wp.setFullscreen(True)
		# activate all the properties we are setting

I resize to 1024,768 for now as I’m just testing. But either way I run it (and I’m doing the following to call it from my main file):

def __init__(self):

and I don’t seem to have a problem

I believe that realtime fullscreen/windowed mode toggling works on Linux, because there the fullscreen mode is a fake anyway and doesn’t require tearing down and recreating the whole window. But this isn’t reliable on all operating systems.


Right. One day, I plan to add true fullscreen support to x11display via xrandr (if noone beats me to it), then switching will probably no longer be possible.

Thanks for the explanation!

I’ve only been using panda for about a week, so I’m not aware of all the ins and outs, but that explains everything, as I’m currently doing dev on a mac, and haven’t tested it on a windows box.

Thanks again. And also, seriously awesome job.