-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_array.py
51 lines (32 loc) · 844 Bytes
/
test_array.py
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
import sys, numpy
import pygame
from pygame.locals import *
from pyglew import *
w,h = 512,512
pygame.display.init()
surface = pygame.display.set_mode((w,h), OPENGL|DOUBLEBUF)
glewInit()
from pygpu import *
from pygpu.functions import float2
from pygpu.types import *
initPyGPU()
raise NotImplemented
@gpu(size = lambda *args: (512,512))
def id(array=Array1D, i=Int2):
return array(i)
glDisable(GL_DEPTH_TEST)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, w, 0, h, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
while True:
#check for quit'n events
event = pygame.event.poll()
if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE):
break
glClear(GL_COLOR_BUFFER_BIT)
res = coords()
res.show()
print numpy.array(res)
pygame.display.flip()