10 |
# OFFS3 |
# OFFS3 |
11 |
|
|
12 |
|
|
13 |
|
import gzz.gfx.gl |
14 |
import java |
import java |
15 |
from math import exp |
from math import exp |
16 |
|
|
50 |
|
|
51 |
|
|
52 |
initialized = 0 |
initialized = 0 |
53 |
def init(): |
def init(texture_components, texture_format): |
54 |
"""Creates and returns textures.""" # XXX need more doc here |
"""Creates and returns textures.""" # XXX need more doc here |
55 |
global initialized |
global initialized |
56 |
initialized = 1 |
initialized = 1 |
344 |
|
|
345 |
class Textures: |
class Textures: |
346 |
textures = None |
textures = None |
347 |
|
paperopt = gzz.gfx.gl.PaperOptions.instance() |
348 |
def __init__(self, seed): |
def __init__(self, seed): |
349 |
|
text_comps, text_form = texture_components, texture_format |
350 |
if not self.textures: |
if not self.textures: |
351 |
self.textures = init() |
|
352 |
print "DEBUG: Textures created" |
if not self.paperopt.use_opengl_1_1: |
353 |
|
text_comps, text_form = 2, 'LUMINANCE_ALPHA' |
354 |
|
|
355 |
|
self.textures = init(text_comps, text_form) |
356 |
|
print "Textures created: components: %d, format: %s" % (text_comps, text_form) |
357 |
|
|
358 |
rnd = java.util.Random(seed) |
rnd = java.util.Random(seed) |
359 |
|
|
360 |
hyper = rnd.nextGaussian()*5 |
hyper = rnd.nextGaussian()*5 |