rendered paste body#! /usr/bin/env python
import xintwa
Quit = False
def QuitHandler(x):
global Quit
Quit=True
print "honorable quit!"
def KeyboardHandler(kb_ev):
if kb_ev.state:
global Quit
Quit= True
print "quitting cause I got me '%s'"% kb_ev.keyname
def LogFunc(l,x):
print "[%i] %s"%(l,x)
TM = xintwa.TextureManager(loader=xintwa.TextureByFilename('./'))
xintwa.init()
xintwa.enable_logging(LogFunc)
xintwa.set_video_mode(640,480, title='xintwa test')
xintwa.lower.ortho2d(-1,1,-1,bottom=1);
x = xintwa.DQuad(1,1, texture=TM.get_resource("tempship.png"));
TM.cleanup()
start = xintwa.ticks()
end = start + 2000
xintwa.lower.clear_screen( 0,0,1.0,1)
x.draw()
xintwa.swap_video_buffer()
while end > xintwa.ticks():
if Quit:
break;
xintwa.event.process_events(key=KeyboardHandler, quit=QuitHandler)
del x
TM.cleanup()
xintwa.quit()