load object and display window, for some reason segfaulting on window close
This commit is contained in:
parent
641665af0c
commit
3b815634f0
@ -1,10 +1,31 @@
|
||||
#!/usr/bin/env pythonw
|
||||
|
||||
import sys
|
||||
import os
|
||||
from PySFML import sf
|
||||
from wfobj import WFObj
|
||||
import getopt
|
||||
|
||||
def main(argv):
|
||||
sys.stdout.write('%s\n' % argv[0])
|
||||
options, args = getopt.getopt(argv[1:], '')
|
||||
if len(args) == 0:
|
||||
sys.stderr.write('Specify object file to load\n')
|
||||
return 2
|
||||
|
||||
obj = WFObj(args[0])
|
||||
|
||||
window = sf.Window(sf.VideoMode(800, 600, 32),
|
||||
'Python Wavefront Object Viewer')
|
||||
|
||||
while window.IsOpened():
|
||||
event = sf.Event()
|
||||
|
||||
while window.GetEvent(event):
|
||||
if event.Type == sf.Event.Closed:
|
||||
window.Close()
|
||||
|
||||
window.Display()
|
||||
|
||||
return 0
|
||||
|
||||
sys.exit(main(sys.argv))
|
||||
|
Loading…
x
Reference in New Issue
Block a user