[maemo-developers] Identifying platform in Python code
From: Fred Pacquier fredp at dial.oleane.comDate: Tue Jun 5 22:53:19 EEST 2007
- Previous message: Identifying platform in Python code
- Next message: Problems with bora maemo repository and apt-get ...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Marius Gedminas a écrit : > On Tue, Jun 05, 2007 at 06:42:41PM +0200, Fred Pacquier wrote: >> My specific problem was determining the screen resolution at the start >> of a pyGame app, to run it fullscreen on the tablet, and windowed on >> other platforms. This does not seem possible from pyGame itself, > > How about taking the largest one from pygame.display.list_modes()? Thanks Marius for the heads-up : I had toyed with that function while exploring the pyGame API, but only on the desktop, and had found it next to useless, at least with Windows. I had not thought of trying it under maemo, where it returns only the (800,480) tuple. So it might be a good "IT detector" with no additional import or filesystem access. > Both approaches will fail when you have a dual-head system -- you'll see > a large combined display size (e.g. 2308x1024 for a 1024x768+1280x1024 > dual-head mode that crashes pygame when you try to switch to it). With > gtk.gdk you can at least find the number of screens and their > resolutions. Hmm, I'll admit I hadn't even *thought* of such a possibility :-) ATM it's not a problem because the app is mostly for my own use, I just need a common code base that will adapt to the various platforms and screens I use it on - none of which is multi-headed. But I'll keep it in mind if/when that happens... Thanks, fp
- Previous message: Identifying platform in Python code
- Next message: Problems with bora maemo repository and apt-get ...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]