comparison scripts/pytouhou @ 554:653a9f087673

Make both double- and single-buffer available on the CLI, but default to SDL’s default.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 30 May 2014 04:06:09 +0200
parents 8f51e34d911c
children bafe6361c0af
comparison
equal deleted inserted replaced
553:8f51e34d911c 554:653a9f087673
57 graphics_group.add_argument('--no-background', action='store_false', help='Disable background display (huge performance boost on slow systems).') 57 graphics_group.add_argument('--no-background', action='store_false', help='Disable background display (huge performance boost on slow systems).')
58 graphics_group.add_argument('--no-particles', action='store_false', help='Disable particles handling (huge performance boost on slow systems).') 58 graphics_group.add_argument('--no-particles', action='store_false', help='Disable particles handling (huge performance boost on slow systems).')
59 graphics_group.add_argument('--no-sound', action='store_false', help='Disable music and sound effects.') 59 graphics_group.add_argument('--no-sound', action='store_false', help='Disable music and sound effects.')
60 60
61 opengl_group = parser.add_argument_group('OpenGL backend options') 61 opengl_group = parser.add_argument_group('OpenGL backend options')
62 opengl_group.add_argument('--single-buffer', action='store_true', help='Disable double buffering.')
63 opengl_group.add_argument('--gl-flavor', choices=['core', 'es', 'compatibility', 'legacy'], default='compatibility', help='OpenGL profile to use.') 62 opengl_group.add_argument('--gl-flavor', choices=['core', 'es', 'compatibility', 'legacy'], default='compatibility', help='OpenGL profile to use.')
64 opengl_group.add_argument('--gl-version', default=2.1, type=float, help='OpenGL version to use.') 63 opengl_group.add_argument('--gl-version', default=2.1, type=float, help='OpenGL version to use.')
64
65 double_buffer = opengl_group.add_mutually_exclusive_group()
66 double_buffer.add_argument('--double-buffer', dest='double_buffer', action='store_true', default=None, help='Enable double buffering.')
67 double_buffer.add_argument('--single-buffer', dest='double_buffer', action='store_false', default=None, help='Disable double buffering.')
65 68
66 args = parser.parse_args() 69 args = parser.parse_args()
67 70
68 71
69 import sys 72 import sys
93 96
94 from importlib import import_module 97 from importlib import import_module
95 for backend in args.backend: 98 for backend in args.backend:
96 if backend == 'opengl': 99 if backend == 'opengl':
97 options = { 100 options = {
98 'double-buffer': not args.single_buffer,
99 'flavor': args.gl_flavor, 101 'flavor': args.gl_flavor,
100 'version': args.gl_version 102 'version': args.gl_version,
103 'double-buffer': args.double_buffer,
101 } 104 }
102 else: 105 else:
103 options = {} 106 options = {}
104 107
105 try: 108 try: