Get actual resolution for pygame

schwerdy schwerdy at web.de
Wed Feb 11 12:28:49 CET 2004


Hi,

I'm trying to write a function with pygame that takes the path to a
.jpg image and displays it in a maximized/fullscreen window. I'm stuck
at pygame.display.set_mode() :-) This function needs a resolution as
parameter... Because I don't want the graphic card to change mode, the
best thing would be to give set_mode the actual display resolution.
But how can I get it? My first idea was to invoke "xwininfo -root",
but thats not platform independent. The other idea was to abuse
Tkinter (root = Tkinter.Tk(); h=root.winfo_vrootheight();
w=root.winfo_vrootwidth()), but thats not satisfying and takes a
while.

Anyone with a better idea?
Or do I have to use "xwininfo"?

Thanks in advance
Schwerdy



More information about the Python-list mailing list