31 |
|
|
32 |
System.setProperty("gzzclient", "gl") |
System.setProperty("gzzclient", "gl") |
33 |
|
|
34 |
from gzz.client import GraphicsAPI |
from gzz.client import AbstractBinder, GraphicsAPI |
35 |
from gzz.gfx.gl import GL, GLRen, GLSpanner, Paper, GLCache |
from gzz.gfx.gl import GL, GLRen, GLSpanner, Paper, GLCache |
36 |
|
|
37 |
from gfx.util.misc import * |
from gfx.util.misc import * |
49 |
|
|
50 |
|
|
51 |
def filescene(vs, file): |
def filescene(vs, file): |
52 |
m = MipzipLoader(file) |
m = MipzipLoader(File(file)) |
53 |
m.loadToBaseLevelSynch(0) |
m.loadToBaseLevelSynch(0) |
54 |
tex = m.getTexture() |
tex = m.getTexture() |
55 |
texid = tex.getTexId() |
texid = tex.getTexId() |
86 |
cs = vs.affineCS(0, "foo", 0, 0, 0, ys, 0, 0, ys) |
cs = vs.affineCS(0, "foo", 0, 0, 0, ys, 0, 0, ys) |
87 |
vs.map.put(l, cs) |
vs.map.put(l, cs) |
88 |
|
|
89 |
|
class Bindings(AbstractBinder): |
90 |
|
def keystroke(self, s): |
91 |
|
print "KEY: '%s'"%s |
92 |
|
def mouse(self, e): |
93 |
|
print "MOUSE: '%s'"%e |
94 |
|
def timeout(self, o): |
95 |
|
print str(System.currentTimeMillis()) + " TIMEOUT ",o |
96 |
|
|
97 |
class Main(Runnable): |
class Main(Runnable): |
98 |
|
|
101 |
|
|
102 |
w = gfxapi.createWindow() |
w = gfxapi.createWindow() |
103 |
w.setLocation(0,0,xs,ys) |
w.setLocation(0,0,xs,ys) |
104 |
|
w.registerBinder(Bindings()) |
105 |
|
|
106 |
file = File("tmp/tmp_0_0_0.mipzip") |
for file in [ |
107 |
vs = w.createVobScene() |
"tmp/tmp_0_0_0.mipzip", |
108 |
filescene(vs, file) |
"tmp/tmp_0_0_1.mipzip", |
109 |
w.renderStill(vs, 0) |
"tmp/tmp_0_0_2.mipzip", |
110 |
|
"tmp/tmp_0_0_3.mipzip" |
111 |
|
]: |
112 |
|
vs = w.createVobScene() |
113 |
|
filescene(vs, file) |
114 |
|
w.renderStill(vs, 0) |
115 |
|
|
116 |
|
|
117 |
|
|