forked from chaosct/ofxPython
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmytest.py
More file actions
executable file
·64 lines (48 loc) · 978 Bytes
/
Copy pathmytest.py
File metadata and controls
executable file
·64 lines (48 loc) · 978 Bytes
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#test
import random
from openframeworks import *
print "-"*30
from threading import Thread
from time import sleep
class myApp(object):
def __init__(self):
self.x = 50.0
self.y = 50.0
self.d = 10
self.fbo = ofFbo()
self.fbo.allocate(100,100)
def update(self):
self.x += random.random()-.5
self.y += random.random()-.5
def draw(self):
self.fbo.begin()
ofClear(0)
color = ofColor(255,0,0)
ofSetColor(color)
ofDrawCircle(self.x,self.y,self.d)
self.fbo.end()
ofSetColor(255,255,255)
self.fbo.draw(200,200)
def mouseMoved(self, x, y):
pass
def mousePressed(self, x, y, button):
pass
def mouseDragged(self, x, y, buton):
pass
def mouseReleased(self, x, y, button):
pass
def keyPressed(self, key):
pass
def keyReleased(self, key):
pass
def windowResized(self, width, height):
pass
#Testing threading capabilities
def athread():
n = 0
while True:
print n
n += 1
sleep(1)
t = Thread(target=athread)
t.start()