When packed panda is a bit picky about what config options to read.
But you can do:
loadPrcFileData("", "multisamples 1")
or:
from panda3d.core import ConfigVariableInt
ConfigVariableInt('multisamples', 1)
or you could ship your game with a config file outside of the game package, then you could do:
from panda3d.core import loadPrcFileData
from direct.showbase.AppRunnerGlobal import appRunner
if appRunner:
path=appRunner.p3dFilename.getDirname()+'/config.prc'
else: #for testing
path='config.prc'
try:
f = open(path, 'r')
for line in f:
if not line.startswith('#'):
loadPrcFileData('',line)
except IOError:
print "No config file, using default"
from panda3d.core import WindowProperties
from panda3d.core import ConfigVariableInt
cfg_win_size=ConfigVariableInt('win-size', '640 480')
wp = WindowProperties.getDefault()
wp.setSize(cfg_win_size.getWord(0),cfg_win_size.getWord(1))
WindowProperties.setDefault(wp)
Thanks for the reply! The first one didn’t work I don’t know why, though I would really prefer the first one. Any idea why? Second and third ones worked great. Thanks a lot!