diff options
Diffstat (limited to 'src/sliceitoff/display/display.py')
-rw-r--r-- | src/sliceitoff/display/display.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sliceitoff/display/display.py b/src/sliceitoff/display/display.py index bdb2514..65b4713 100644 --- a/src/sliceitoff/display/display.py +++ b/src/sliceitoff/display/display.py @@ -1,13 +1,15 @@ +""" display.display - Routines to init and display graphics on screen """ import os import pygame from .scaling import Scaling -from .colors import CGA_COLORS +from .static import CGA_COLORS DEBUG = os.getenv("DEBUG") class Display(): + """display.Display - Handles graphics. Init, clear, draw, borders... """ def __init__(self): pygame.display.init() mode_info = pygame.display.Info() @@ -16,7 +18,6 @@ class Display(): pygame.FULLSCREEN | pygame.SCALED, vsync = 1 ) Scaling.update_scaling(self.screen.get_size()) - #self.screen.fill(0) if DEBUG: print( "DISPLAY: \n" @@ -24,6 +25,9 @@ class Display(): f" {Scaling.borders = }\n" f" {Scaling.factor = }\n") + def __del__(self): + pygame.display.quit() + def update(self, groups = None): """ Updates the screen: clear, blit gropus and flip """ self.screen.fill(CGA_COLORS[4], rect=Scaling.active) @@ -32,6 +36,3 @@ class Display(): self.screen.fill(0, rect=Scaling.borders[0]) self.screen.fill(0, rect=Scaling.borders[1]) pygame.display.flip() - - def __del__(self): - pygame.display.quit() |