def init_graphics(self): """ Creates GraphicsEngine, GraphicsPipe, and loader """ # Get a handle to the graphics pipe selector selection = GraphicsPipeSelection.getGlobalPtr() # Check for DISPLAY if "DISPLAY" in os.environ: # Use the first option (should be glx) pipe_type = selection.getPipeTypes()[0] else: # Use the last option (should be some fallback module) pipe_type = selection.getPipeTypes()[-1] # Create the graphics pipe self.pipe = selection.makePipe(pipe_type) # Get the graphics engine self.engine = GraphicsEngine.getGlobalPtr() # Get the model loader object and assign it to the engine self.loader = Loader.Loader(self) self.engine.setDefaultLoader(self.loader.loader)
def destroy_windows(cls): """ General destroy windows method.""" GraphicsEngine.getGlobalPtr().removeAllWindows()