[visionegg] Re: changing screen dimensions dynamically

  • From: Douglas Taylor <dtaylor@xxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Thu, 26 Jan 2006 14:06:23 -0800

Thanks much.

Doug


Mark Halko wrote:

Visionegg should turn double buffering automatically, unless you've changed it in your config file.
Check the source for Configuration.py to see what the defaults are, and check your own config file to see what they are.
You can also set double_buffer in the constructor to whatever you wish.



These are all the possible parameters to pass to the screen constructor:

alpha_bits -- number of bits per pixel for alpha channel. Can be set with VISIONEGG_REQUEST_ALPHA_BITS (UnsignedInteger)
Default: (determined at runtime)
blue_bits -- number of bits per pixel for blue channel. Can be set with VISIONEGG_REQUEST_BLUE_BITS (UnsignedInteger)
Default: (determined at runtime)
double_buffer -- use double buffering? Can be set with VISIONEGG_DOUBLE_BUFFER (Boolean)
Default: (determined at runtime)
frameless -- remove standard window frame? Can be set with VISIONEGG_FRAMELESS_WINDOW (Boolean)
Default: (determined at runtime)
fullscreen -- use full screen? Can be set with VISIONEGG_FULLSCREEN (Boolean)
Default: (determined at runtime)
green_bits -- number of bits per pixel for green channel. Can be set with VISIONEGG_REQUEST_GREEN_BITS (UnsignedInteger)
Default: (determined at runtime)
hide_mouse -- hide the mouse cursor? Can be set with VISIONEGG_HIDE_MOUSE (Boolean)
Default: (determined at runtime)
is_stereo -- allocate stereo framebuffers? Can be set with VISIONEGG_REQUEST_STEREO (Boolean)
Default: (determined at runtime)
maxpriority -- raise priority? (platform dependent) Can be set with VISIONEGG_MAXPRIORITY (Boolean)
Default: (determined at runtime)
multisample_samples -- preferred number of multisamples for FSAA (UnsignedInteger)
Default: (determined at runtime)
preferred_bpp -- preferred bits per pixel (bit depth) Can be set with VISIONEGG_PREFERRED_BPP (UnsignedInteger)
Default: (determined at runtime)
red_bits -- number of bits per pixel for red channel. Can be set with VISIONEGG_REQUEST_RED_BITS (UnsignedInteger)
Default: (determined at runtime)
size -- size (units: pixels) Can be set with VISIONEGG_SCREEN_W and VISIONEGG_SCREEN_H (Sequence2 of Real)
Default: (determined at runtime)
sync_swap -- synchronize buffer swaps to vertical sync? Can be set with VISIONEGG_SYNC_SWAP (Boolean)
Default: (determined at runtime)


On Jan 26, 2006, at 3:52 PM, Simeon Fitch wrote:

I'm not sure if this is really answering your question, but when I've
had to pass properties to pygame that I would have normally passed via
glutInit() I've use the functions pytame.display.set_mode() or
pygame.display.gl_set_attribute() methods:


http://www.pygame.org/docs/ref/pygame_display.html#set_mode http://www.pygame.org/docs/ref/pygame_display.html#gl_set_attribute

for example:
pygame.display.gl_set_attribute(pygame.locals.GL_STENCIL_SIZE, 8)

So you should be able to set the double buffering flag this way,
although I believe it is turned on (by VisionEgg?) by default.

Best,

Simeon

On 1/26/06, Douglas Taylor <dtaylor@xxxxxxx> wrote:

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



--
Simeon H.K. Fitch, Owner
Mustard Seed Software
1634 Brandywine Drive
Charlottesville, VA  22901
210.867.1616
======================================
The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html


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


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

Other related posts: