1 |
from __future__ import nested_scopes |
from __future__ import nested_scopes |
2 |
|
|
|
font = None |
|
|
fontsize = 40 |
|
|
def getText(text, x = 0, y = 0, z = 2, w = 1, h = 1): |
|
|
global font |
|
|
if font == None: |
|
|
font = GL.createFont("gfx/fonts/a010013l.pfb", fontsize) |
|
|
|
|
|
return GLRen.createHorizText(font, text, x, y, z, w,h) |
|
|
|
|
|
def putText(vs, cs1, text, color = None, x = 0, y = 0, z = 2, w = 1, h = 1): |
|
|
if color != None: |
|
|
putnoc(vs, getDListNocoords("Color " + js(color))) |
|
|
putnoc(vs, getDListNocoords(""" |
|
|
PushAttrib ENABLE_BIT |
|
|
Disable ALPHA_TEST |
|
|
Disable DEPTH_TEST |
|
|
Enable TEXTURE_2D |
|
|
Enable BLEND |
|
|
BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA |
|
|
""")) |
|
|
|
|
|
t = getText(text, x, y, z, w, h) |
|
|
vs.map.put(t, cs1) |
|
|
|
|
|
putnoc(vs, getDListNocoords(""" |
|
|
PopAttrib |
|
|
""")) |
|
|
|
|
|
|
|
3 |
def parstr(name): |
def parstr(name): |
4 |
return name + ": " + js(GL.getGLFloat(name)) |
return name + ": " + js(GL.getGLFloat(name)) |
5 |
|
|
115 |
]] |
]] |
116 |
|
|
117 |
|
|
118 |
putText(vs, cs1, vendor, color=(0,0,0), w=.02, h=.02, y = 1) |
putText(vs, cs1, vendor, color=(0,0,0), w=.8, h=.8, y = 1) |
119 |
putText(vs, cs1, renderer, color=(0,0,0), w=.02, h=.02, y = 2) |
putText(vs, cs1, renderer, color=(0,0,0), w=.8, h=.8, y = 2) |
120 |
putText(vs, cs1, version, color=(0,0,0), w=.02, h=.02, y = 3) |
putText(vs, cs1, version, color=(0,0,0), w=.8, h=.8, y = 3) |
121 |
|
|
122 |
foo = params |
foo = params |
123 |
i = 0 |
i = 0 |
127 |
for y in range(0, lines): |
for y in range(0, lines): |
128 |
if i >= len(foo): break |
if i >= len(foo): break |
129 |
|
|
130 |
putText(vs, cs1, foo[i], color=(0,0,0), w=.008, h=.008, |
putText(vs, cs1, foo[i], color=(0,0,0), w=.32, h=.32, |
131 |
x=x*(1200./40/rows), y=y*.5+4) |
x=x*(1200./40/rows), y=y*.5+4) |
132 |
i += 1 |
i += 1 |
133 |
|
|
141 |
for y in range(0, lines): |
for y in range(0, lines): |
142 |
if i >= len(foo): break |
if i >= len(foo): break |
143 |
|
|
144 |
putText(vs, cs1, foo[i], color=(0,0,0), w=.008, h=.008, |
putText(vs, cs1, foo[i], color=(0,0,0), w=.32, h=.32, |
145 |
x=x*(1200./40/rows), y=y*.5+14) |
x=x*(1200./40/rows), y=y*.5+14) |
146 |
i += 1 |
i += 1 |
147 |
|
|