Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
notro edited this page Feb 16, 2013 · 5 revisions

To make pygame use the display, two evironment variables must be set:

Shell

export SDL_FBDEV=/dev/fb1
export SDL_VIDEODRIVER=fbcon

Python test

import os
import pygame

if not os.getenv('SDL_FBDEV'):
    os.putenv('SDL_FBDEV', '/dev/fb1')
	
if not os.getenv('SDL_VIDEODRIVER'):
    os.putenv('SDL_VIDEODRIVER', 'fbcon')

pygame.display.init()

size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
print "Framebuffer size: %d x %d" % (size[0], size[1])

Ref: http://learn.adafruit.com/pi-video-output-using-pygame/pointing-pygame-to-the-framebuffer

Clone this wiki locally