I’m using Ubuntu (Naughty Narwhal), and for some reason I can’t seem to make use of OnscreenImage. When ever I do I get the following:
No suitable FBConfig contexts available; using XVisual only
.
I realise some have had this problem in the past but I seem to recall this was more of a global issue, whereas in my case OnscreenImage is the only thing that produces the error.
That message would be produced by the code that opens a window or an offscreen buffer; it has nothing to do with the OnscreenImage code. I think you must be slightly misled by your program structure: you would see that error message whether or not you are using OnscreenImage.
It’s not necessarily a fatal error. It means that your graphics driver does not provide the more modern FBConfig interface to open a window, so instead Panda has to fall back to the older XVisual interface. There have been some reports of the XVisual interface support being buggy, though. Does it successfully open a window?
It loads windows fine, and running through the samples hasn’t reproduced the error. I finally tried stripping my code down to the manuals example code for OnscreenImage. While it seems nonsensical to me, that’s the only thing that makes the driver and/or Panda yell at me. I tried
gl-support-fbo 0
glx-support-fbconfig 0
in my config and it let me run the script but it was just a blank window. I should mention in windows 7 the sript runs fine
which I think would indicate a driver but I’m not real certain what’s going wrong.
from direct.directbase.DirectStart import *
from direct.gui.OnscreenImage import OnscreenImage
from pandac.PandaModules import *
from direct.showbase import DirectObject
base.disableMouse()
props = WindowProperties()
props.setCursorHidden(True)
base.win.requestProperties(props)
a = '1.jpg'
imageObject = OnscreenImage(image = a, pos = (0, 0, 0))
run()
But if I attempt to add any functionaly to the script it returns the error even with a properly based image
from direct.directbase.DirectStart import *
from direct.gui.OnscreenImage import OnscreenImage
from pandac.PandaModules import *
import sys
import random
from direct.showbase import DirectObject
base.disableMouse()
props = WindowProperties()
props.setCursorHidden(True)
base.win.requestProperties(props)
global y
y=1
def next1():
c=y
b=str(c)
a=b + ".jpg"
imageObject = OnscreenImage(image = a, pos = (0, 0, 0))
class DoIt(DirectObject.DirectObject):
def __init__(self):
self.accept('arrow_up', self.up)
self.accept('arrow_down', self.down)
def up(self):
#global y
if y > 4:
next1()
else:
global y
y +=1
next1()
def down(self):
#global y
if y < 2:
next1()
else:
global y
y -=1
next1()
h = DoIt()
run()
I was trying to multi-task when I typed the preceding script so it was a little nonsensical (although looking at it now it still has a pointless global, oops). Out of frustration I reinstalled a number of my nvidia packages in synaptic and purged some graphics related stuff I wasn’t using. In doing so, the problem has since went away.
I’d like to know what I did to cause the issue in the first place so I don’t do it again but right I’m satisfied just being able to run my application in both Linux and Windows