- 1Premise
- 2C, Xlib, Xrandr on Linux/Xorg
- 3VC++, WinAPI, GDI+ on Windows
- 4C, OpenGL, GLUT on Linux and Windows
- 5Qt 5 on Windows
- 6C, SDL2 on Linux
- 7Python, PyGame on Linux and Windows
- 8QuickBASIC on DOS
- 9Measuring Processing Requirements
- 10Measuring Memory Requirements
- 11Results of the Measurments
Python, PyGame on Linux and Windows
This solution requires a Python interpreter and the PyGame library.
Built on top of Simple DirectMedia Layer (SDL), PyGame supports a variety of display environments on multiple operating systems. The program has been successfully tested on these systems:
- Devuan GNU/Linux 1.0 on a PC with Xorg,
- Debian GNU/Linux 9.0 on a Banana Pi framebuffer and
- MS Windows 10.
#!/usr/bin/env python """Draw a yellow rectangle.""" from pygame import display, draw, event, init, time, FULLSCREEN from pygame.locals import KEYDOWN, QUIT screen = display.set_mode((640, 480), FULLSCREEN) init() draw.rect(screen, (255, 255, 0), (10, 20, 100, 75), 0) while True: for e in event.get(): if e.type == QUIT or e.type == KEYDOWN: display.quit() exit(0) display.update() time.wait(250)