[visionegg] Re: changing screen dimensions dynamically

  • From: Douglas Taylor <dtaylor@xxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Thu, 26 Jan 2006 11:00:54 -0800

Would you also have to specify OPENGL and DOUBLEBUF
or are these turned on by default. Thanks,

Doug


Mark Halko wrote:


On Jan 26, 2006, at 11:16 AM, Russ Poldrack wrote:

hi - I'm writing a program that is meant to be run across multiple computers with different screen resolutions, and I'm wondering whether there is any way to adjust the default size used by get_default_screen() to maximize the screen size depending upon the video resolution of the system? The obvious way would be to have the user enter the dimensions in the initial config window, but I would like to make it automatic so that the user doesn't have to determine what their screen resolution is. I know how to get the maximum screen size using Tk. I see that there is a set_size() method under the VisionEgg Screen class, but it seems to be deprecated. One apparent possibility is to turn off the initial display of the screen using VisionEgg.config.VISIONEGG_GUI_INIT - however, it's not then clear to me how to actually set the parameters and display the screen. Any suggestions would be most appreciated.


I'd use pygame to query the maximum screensize:
>>> import pygame
>>> pygame.display.init()
>>> pygame.display.list_modes()
[(1920, 1440), (1856, 1392), (1792, 1344), (1600, 1200), (1600, 1024), (1344, 1008), (1280, 1024), (1280, 960), (1152, 870), (1152, 864), (1024, 768), (832, 624), (800, 600), (640, 480)]


or:
>>> max(pygame.display.list_modes())
(1920, 1440)

You can then use the default constructor for the Screen class yourself:
screen = Screen(size = (1024, 768), fullscreen = True, red_bits = 8, green_bits = 8, blue_bits = 8,alpha_bits = 8)


where (1024,768) is your desired screen size.

The get_default_screen is just an alternate constructor. If you want to use the config file for other options, you can omit them in the constructor, and the constructor will find them in the config file (at least, that's what the source claims to do)

Check the source for Screen.__init__ in Core.py :
http://visionegg.org/cgi-bin/viewcvs.cgi/trunk/visionegg/src/Core.py? rev=1338&view=markup




Also - is there any way to specify a particular VisionEgg.cfg file to be read in, rather than the default locations?


I haven't personally done it, but in Configuration.py it says:

However, You can specify a different filename and directory by setting
the environment variable VISIONEGG_CONFIG_FILE.

Mark
=====================================
The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.htm
l


======================================
The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: