No support for framebuffer rendering in pygamezero ?
- Dominant language
- Python
- Stars
- 611
- Forks
- 211
- PR merge metrics
- No merged PRs in 30d
Description
Originally reported by: **brice.copy@cern.ch (Bitbucket: [bcopy](https://bitbucket.org/bcopy), GitHub: [bcopy](https://github.com/bcopy))**
----------------------------------------
On touchscreens, Pygame can render directly to framebuffer.
However, the Pygamezero runner seems to have a problem with screen setup :
File "/usr/local/lib/python3.4/dist-packages/pgzero/runner.py", line 81, in main
pygame.display.set_mode((100, 100), DISPLAY_FLAGS)
pygame.error: Couldn't set console screen info
Setting the usual SDL enviroment variables to point Pygame to the framebuffer in the usual way does not work for Pygamezero :
----
pgtest.py
```
#!python
WIDTH = 300
HEIGHT = 300
def draw():
screen.fill((128, 0, 0))
```
----
Running the above script (even as sudo) with :
```
#!shell
SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb0 pgzrun pgztest.py
```
Gives the following :
```
#!shell
Traceback (most recent call last):
File "/usr/local/bin/pgzrun", line 9, in
load_entry_point('pgzero==1.1', 'console_scripts', 'pgzrun')()
File "/usr/local/lib/python3.4/dist-packages/pgzero/runner.py", line 81, in main
pygame.display.set_mode((100, 100), DISPLAY_FLAGS)
pygame.error: Couldn't set console screen info
```
----
I was wondering whether one could use pygamezero without the pgzrun runner utility (and perhaps bypass this forceful mode setting ?).
----------------------------------------
- Bitbucket: https://bitbucket.org/lordmauve/pgzero/issue/49
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with pgzero/runner.py at the pygame.display.set_mode call on line 81, then reproduce the issue by running the supplied pgztest.py with SDL_VIDEODRIVER=fbcon and SDL_FBDEV=/dev/fb0. Determine how pgzrun's forced screen setup affects framebuffer rendering and whether the runner can support this configuration. Done means the example launches and renders directly to the framebuffer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100