stodge
January 5, 2011, 6:31pm
1
Ok this is an epic fail on my part I think. I’m simply trying to write a tiny program that creates a Panda3D window that is 800x600. Panda3D always wants to go full screen.
import direct.directbase.DirectStart
from panda3d.core import WindowProperties
def setScreen():
wp = WindowProperties()
wp.setFullscreen(False)
wp.setSize(800,600)
base.win.requestProperties( wp )
setScreen()
run()
Am I doing something wrong? Thanks
DirectStart: Starting the game.
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
:display:glxdisplay(error): Could not find a usable pixel format.
:display:x11display(error): BadMatch (invalid parameter attributes)
:display:gsg:glgsg(warning): Unable to query GL_VENDOR
:display:gsg:glgsg(warning): Unable to query GL_RENDERER
:display:x11display(error): BadMatch (invalid parameter attributes)
:display:x11display(error): BadMatch (invalid parameter attributes)
:display(warning): FrameBufferProperties available less than requested.
:display:x11display(error): BadMatch (invalid parameter attributes)
This is on Fedora 12 using the NVIDIA driver.
Thanks
stodge
January 5, 2011, 6:34pm
2
I also tried this:
from direct.showbase.ShowBase import ShowBase
from panda3d.core import WindowProperties
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
def set_screen(self):
wp = WindowProperties()
wp.setFullscreen(False)
wp.setSize(800,600)
base.win.requestProperties( wp )
app = MyApp()
app.set_screen()
app.run()
Sothh
January 5, 2011, 7:07pm
3
I don’t know if its of any use, but:
#Import loadPrcFileData:
from pandac.PandaModules import loadPrcFileData
#Set the window title:
loadPrcFileData("","window-title ")
#Set window size:
loadPrcFileData("","win-size 1024 768")
#Keep the window from being resized:
loadPrcFileData("","win-fixed-size 0")
Anon
January 5, 2011, 7:10pm
4
Works on Windows. This is a guess, but try to comment the setFullscreen line and see if it works.
EDIT: The above code isnt for runtime fullscreen toggle. loadPrcFileData("",“win-size x y”) is done before importing directStart/showBase
stodge
January 5, 2011, 7:12pm
5
I still get a full screen app:
from direct.showbase.ShowBase import ShowBase
from panda3d.core import WindowProperties
from pandac.PandaModules import loadPrcFileData
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
def set_screen(self):
wp = WindowProperties()
wp.setFullscreen(False)
wp.setSize(800,600)
base.win.requestProperties( wp )
#Set the window title:
loadPrcFileData("","window-title ")
#Set window size:
loadPrcFileData("","win-size 1024 768")
#Keep the window from being resized:
loadPrcFileData("","win-fixed-size 0")
app = MyApp()
app.run()
Sothh
January 5, 2011, 7:21pm
6
You have to do the Prc loads before you create the window.
stodge
January 5, 2011, 7:26pm
7
Isn’t that what I’m doing by doing the prc loads before creating the App instance?
stodge
January 5, 2011, 7:34pm
8
The problem could be that I have two monitors connected to my laptop and I’m using NVIDIA’s twinview. Let me disable one.
stodge
January 5, 2011, 7:36pm
9
No difference. I added:
loadPrcFileData("", "fullscreen 0")
But it still goes full screen.
drwr
January 6, 2011, 1:04am
10
Panda won’t automatically go fullscreen unless you ask it to. So if you’re going fullscreen, it means either that:
(a) your driver is automatically going fullscreen regardless of what Panda asks for (e.g. your twinview guess), or
(b) you are asking for a fullscreen window.
The only way to ask for a fullscreen window is to have “fullscreen 1” in a .prc file or pre-loaded with loadPrcFileData(). To check whether you have “fullscreen 1” in some prc file, use:
print ConfigVariableBool('fullscreen')
it will tell you what prc files are defining the value for fullscreen and what the current value is.
If no prc file is setting fullscreen on, then it must be something funky in your driver.
Does pview also go to fullscreen?
David