Bluecat - 2005-07-05

I've been trying to get PyUI2 working with GLUT and I'm not having too much success. I'm not particularly familiar with GLUT, having never really used it, so I was wondering if anyone here has any ideas.

At this stage PyUI2 fires up okay. The window is created and all the graphics render and the main loop appears to be working. The problem is that GLUT is not receiving or processing any system events. The following code initialises GLUT:

class GLUTDevice(Device):
    def __init__(self, width, height, fullscreen):
        print "glut::__init__()"
        Device.__init__(self)

        self.size = (width, height)
        self.fullscreen = fullscreen

        glutInit(sys.argv)
        glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)

        if self.fullscreen:
            glutGameModeString("%dx%d:32@70" % self.size )
            self.windowID = glutEnterGameMode()
        else:
            glutInitWindowSize(self.size[0], self.size[1])
            glutInitWindowPosition(0,0)
            self.windowID = glutCreateWindow("")

        glutSetWindow(self.windowID)

        glutReshapeFunc(self.reSizeGLScene)
        glutMouseFunc(self.onMouse)
        glutMotionFunc(self.onMotion)
        glutPassiveMotionFunc(self.onMotion)
        glutKeyboardFunc(self.onKeyDown)
        glutKeyboardUpFunc(self.onKeyUp)
        glutSpecialFunc(self.onSpecialDown)
        glutSpecialUpFunc(self.onSpecialUp)

        self.graphicsDevice = OpenGLGraphics(self.size)

When I click the mouse on the screen I expect to see the onMouse function called, and when I move the mouse over, I expect to see the onMotion function called. This isn't happening.

Anyone have any ideas?

The full code is in CVS under the system folder. Let me know if you need more info.

cheers

John