2011-03-27 02:46:16 +00:00
|
|
|
from csdl import init, INIT
|
|
|
|
from csdl.video import Window
|
|
|
|
|
2011-03-16 02:37:29 +00:00
|
|
|
import random
|
|
|
|
import time
|
|
|
|
|
|
|
|
def main():
|
2011-03-27 02:13:22 +00:00
|
|
|
init(INIT.EVERYTHING)
|
2011-03-16 02:37:29 +00:00
|
|
|
window = Window('test', 100, 100, 512, 512, 0)
|
|
|
|
|
|
|
|
while True:
|
|
|
|
window.renderer.set_draw_color(0,0,0,255)
|
|
|
|
window.renderer.clear()
|
|
|
|
window.renderer.set_draw_color(255,0,0,255)
|
|
|
|
for i in xrange(20):
|
|
|
|
window.renderer.set_draw_color(random.randint(0,255),
|
|
|
|
random.randint(0,255),
|
|
|
|
random.randint(0,255))
|
|
|
|
p1 = (random.randint(0,512), random.randint(0, 512))
|
|
|
|
p2 = (random.randint(0,512), random.randint(0, 512))
|
|
|
|
p3 = (random.randint(0,512), random.randint(0, 512))
|
|
|
|
window.renderer.draw_lines([p1, p2, p3, p1])
|
|
|
|
window.renderer.present()
|
|
|
|
time.sleep(.001)
|
|
|
|
main()
|