summaryrefslogtreecommitdiff
path: root/cad/src/experimental/demoapp_0.1/main.py
blob: 8bc9e8f1300b1f56588417706cdabbb5ba1c5d8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /usr/bin/env python

"""
This file, and some of the files in the same directory and/or its subdirs,
are copied and modified from delta_v-r3/run_game.py and/or other programs
by Alex H., author of pyglet. Each such file says so inside it.
"""

import sys

import optparse

import pyglet

from demoapp.ui.DemoAppWindow import DemoAppWindow

if __name__ == '__main__':
    op = optparse.OptionParser()
    op.add_option('-W', '--width', dest='width', type='int', default = 800,
                  help='width of window')
    op.add_option('-H', '--height', dest='height', type='int', default = 600,
                  help='height of window')
    op.add_option('-f', '--fullscreen', dest='fullscreen', default = False,
                  action='store_true', help='use an entire screen')
    options, args = op.parse_args()

    # In case the user doesn't run in -O
##    pyglet.options['gl_error_check'] = False

    if options.fullscreen:
        window = DemoAppWindow( fullscreen = options.fullscreen)
    else:
        window = DemoAppWindow(
                              width = options.width,
                              height = options.height,
                             )
##    state = mainmenu.MainMenu()
##    window.push_state(state)

    pyglet.app.run()