/[gzz]/gzz/gfx/libpaper/papermill.py
ViewVC logotype

Diff of /gzz/gfx/libpaper/papermill.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34 by jvk, Fri Oct 4 13:18:18 2002 UTC revision 1.35 by jvk, Mon Oct 7 12:14:04 2002 UTC
# Line 1  Line 1 
1  dbg = 0  #initialized = 0
2  initialized = 0  
3    from gfx.libutil.myimport import my_import
4    
5  import gfx.libpaper.textures  my_import("gfx.libpaper.textures")
 reload(gfx.libpaper.textures)  
6  from gfx.libpaper.textures import Textures  from gfx.libpaper.textures import Textures
7    
8  import gfx.libpaper.colors  my_import("gfx.libpaper.colors")
 reload(gfx.libpaper.colors)  
9  from gfx.libpaper.colors import Colors  from gfx.libpaper.colors import Colors
10    
11    my_import("gfx.libpaper.texcoords")
12    from gfx.libpaper.texcoords import TexGenXYRepeatUnit
13    
14    my_import("gfx.libpaper.params")
15    from gfx.libpaper.params import *
16    
17  from gzz.gfx.gl import GL,GLRen,Paper,PaperMill  from gzz.gfx.gl import GL,GLRen,Paper,PaperMill
18  import java  import java
19  from java.lang import Math  from java.lang import Math
20  def initialize():  
21      global initialized  #def initialize():
22      if initialized: return  if 1:
23      initialized = 1      #global initialized
24        #if initialized: return
25        #initialized = 1
26      dbg=1      dbg=1
27      # Discriminate between different renderers.      # Discriminate between different renderers.
28      # These are for debug output only.      # These are for debug output only.
# Line 28  def initialize(): Line 35  def initialize():
35      # The backend files to load      # The backend files to load
36      files = [      files = [
37          #"textures.py",          #"textures.py",
38          "texcoords.py",          #"texcoords.py",
39          #"colors.py",          #"colors.py",
40          "params.py"          #"params.py"
41          ]          ]
42    
43      #      #
# Line 43  def initialize(): Line 50  def initialize():
50          # XXX Should check separately for texture_shader2,          # XXX Should check separately for texture_shader2,
51          # otherwise it'll be SLOW.          # otherwise it'll be SLOW.
52          if dbg: print "Using NV20 texture shaders"          if dbg: print "Using NV20 texture shaders"
53          files.append("texops_NV2X.py")          #files.append("texops_NV2X.py")
54          #from gfx.libpaper.texops_NV2X import *          my_import("gfx.libpaper.texops_NV2X")
55            from gfx.libpaper.texops_NV2X import *
56            
57      else:      else:
58          if dbg: print "Using unextended OpenGL texture accesses"          if dbg: print "Using unextended OpenGL texture accesses"
59          files.append("texops_STD.py")          #files.append("texops_STD.py")
60          #from gfx.libpaper.texops_STD import *          my_import("gfx.libpaper.texops_STD")
61            from gfx.libpaper.texops_STD import *
62    
63    
64      # Check which combiners to use.      # Check which combiners to use.
# Line 59  def initialize(): Line 69  def initialize():
69          if maxcomb < 4:          if maxcomb < 4:
70              # use NV10 version              # use NV10 version
71              if dbg: print "Using NV10 combiners ",maxcomb              if dbg: print "Using NV10 combiners ",maxcomb
72              files.append("texcomb_NV1X.py")              #files.append("texcomb_NV1X.py")
73                my_import("gfx.libpaper.texcomb_NV1X")
74                from gfx.libpaper.texcomb_NV1X import *
75          else:          else:
76              # use NV20 version              # use NV20 version
77              if dbg: print "Using NV20 combiners ",maxcomb              if dbg: print "Using NV20 combiners ",maxcomb
78              files.append("texcomb_NV2X.py")              #files.append("texcomb_NV2X.py")
79                my_import("gfx.libpaper.texcomb_NV2X")
80                from gfx.libpaper.texcomb_NV2X import *
81      else:      else:
82          assert 0, "Sorry, can't do without NVIDIA register combiners yet."          assert 0, "Sorry, can't do without NVIDIA register combiners yet."
83    
# Line 71  def initialize(): Line 85  def initialize():
85          print "Load file ",f          print "Load file ",f
86          execfile("gfx/libpaper/"+f, globals())          execfile("gfx/libpaper/"+f, globals())
87    
88    dbg = 0
89    
90  def randvec(rnd): return [rnd.nextDouble() for i in range(0,3)]  def randvec(rnd): return [rnd.nextDouble() for i in range(0,3)]
91    
92  def randunitvec(rnd):  def randunitvec(rnd):
# Line 112  def setDummyPass(pas): Line 128  def setDummyPass(pas):
128      pas.setTeardowncode("PopAttrib")      pas.setTeardowncode("PopAttrib")
129    
130  class ThePaperMill(PaperMill):  class ThePaperMill(PaperMill):
131      initialize()      #initialize()
132    
133      def getPaper(self, seed, passmask=[1,1,1,1,1,1,1]):      def getPaper(self, seed, passmask=[1,1,1,1,1,1,1]):
134          reg = Registry()          reg = Registry()

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26