framebuffer display option added

This commit is contained in:
Frank DeMarco 2020-04-06 02:08:55 -04:00
parent 2ff6743ea1
commit 8ce09138d2
2 changed files with 7 additions and 2 deletions

View File

@ -85,6 +85,7 @@ class Configuration(RawConfigParser):
set_option(section, "framerate-text-size", "16", False)
set_option(section, "framerate-text-color", "0, 0, 0", False)
set_option(section, "framerate-text-background", "255, 255, 255", False)
set_option(section, "use-framebuffer", "no", False)
section = "input"
add_section(section)
set_option(section, "release-suffix", "-release", False)
@ -401,7 +402,7 @@ class TypeDeclarations(dict):
"framerate-text-size"],
"bool": ["centered", "skip-frames", "fullscreen",
"show-framerate"],
"show-framerate", "use-framebuffer"],
"int-list": ["dimensions", "framerate-text-color",
"framerate-text-background"]},

View File

@ -1,4 +1,4 @@
import pygame
import os, pygame
from pygame.locals import *
from .Animation import Animation
@ -26,6 +26,10 @@ class Game(Animation):
self.config_rel_path = config_rel_path
self.type_declarations = type_declarations
self.set_configuration()
if self.get_configuration("display", "use-framebuffer"):
os.putenv("SDL_FBDEV", "/dev/fb0")
os.putenv("SDL_VIDEODRIVER", "fbcon")
os.putenv("SDL_NOMOUSE", "1")
pygame.init()
self.set_children()
self.subscribe(self.end, QUIT)