How do I get a fullscreen ?

Since the window is opened automatically when you import DirectStart, setting the “fullscreen” variable after the window is opened is too late. You can set the variable before you import DirectStart, but that’s still just a one-time step that changes the window’s state at the beginning, and not again.

To change the window properties while the application is running, you can use base.win.requestProperties(), e.g.:

wp = WindowProperties()
wp.setSize(640, 480)
base.win.requestProperties(wp)

Note that requestProperties() does not take effect right away, but rather will take effect the next frame. If you need to wait for the result to happen now, you can call base.graphicsEngine.openWindows(), which does not return until all pending window events have completed.

The above allows you to resize and/or reposition the windows, as well as change a few other properties, like title and mouse pointer and such. Unfortunately, you cannot change a non-fullscreen window to a fullscreen window or vice-versa this way. If you want to switch between fullscreen mode, you will have to close the current window and open a new one. That’s a bit more complicated, but it’s still perfectly doable:

wp = WindowProperties()
wp.setFullscreen(1)
wp.setSize(1024, 768)
base.openMainWindow()
base.win.requestProperties(wp)
base.graphicsEngine.openWindows()

It’s even possible to change between DirectX and OpenGL at runtime in this way, by reassigning base.pipe before doing the above.

David