예제 #1
0
def init():
    """Initialise the screen and game screen, and set default options.
    """
    try:
        flags = 0
        if options.fullscreen():
            flags |= FULLSCREEN
        # flags |= RESIZABLE

        # initialise the screen
        global screen
        screen = pygame.display.set_mode(options.dimensions(), flags)

        # initialise the game_screen
        global game_screen
        game_screen = pygame.Surface(options.game_dimensions())

        pygame.mouse.set_visible(False)
        pygame.display.update()

    except pygame.error as msg:
        raise pygame.error("Failed to initialize render engine {0}".format(str(msg)))
예제 #2
0
def update_fullscreen():
    """Update the fullscreen flag to align with the options.
    """
    pygame.display.set_mode(screen.get_size(), FULLSCREEN if options.fullscreen() else 0)