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

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

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

revision 1.42 by mudyc, Thu Dec 5 14:34:49 2002 UTC revision 1.43 by jvk, Fri Jan 31 12:09:49 2003 UTC
# Line 29  class NamedTexture: Line 29  class NamedTexture:
29          self.continuous = 1          self.continuous = 1
30          self.minfilter = "LINEAR_MIPMAP_LINEAR"          self.minfilter = "LINEAR_MIPMAP_LINEAR"
31          self.magfilter = "LINEAR"          self.magfilter = "LINEAR"
32            self.maxaniso = ""
33            if gzz.gfx.gl.GL.hasExtension("GL_EXT_texture_filter_anisotropic"):
34                self.maxaniso = "2.0"
35    
36            
37          # Update from specified values          # Update from specified values
38          self.__dict__.update(dict)          self.__dict__.update(dict)
39    
# Line 42  class NamedTexture: Line 46  class NamedTexture:
46          if not hasattr(self, "texture"):          if not hasattr(self, "texture"):
47              print "Generating texture: ", self.name, self.args              print "Generating texture: ", self.name, self.args
48              self.texture = getCachedTexture(self.args)              self.texture = getCachedTexture(self.args)
49              self.texture.setTexParameter("TEXTURE_2D", "TEXTURE_MIN_FILTER", self.minfilter)              # XXX: FIXME: 1D/3D textures!!!
50              self.texture.setTexParameter("TEXTURE_2D", "TEXTURE_MAG_FILTER", self.magfilter)              target = "TEXTURE_2D"
51                self.texture.setTexParameter(target, "TEXTURE_WRAP_S", "REPEAT")
52                self.texture.setTexParameter(target, "TEXTURE_WRAP_T", "REPEAT")
53                self.texture.setTexParameter(target, "TEXTURE_MIN_FILTER", self.minfilter)
54                self.texture.setTexParameter(target, "TEXTURE_MAG_FILTER", self.magfilter)            
55                if (self.maxaniso and (self.minfilter + self.magfilter).find("NEAREST")):
56                    self.texture.setTexParameter(target, "TEXTURE_MAX_ANISOTROPY_EXT", self.maxaniso)
57    
58          return self.texture.getTexId()          return self.texture.getTexId()
59    
60      def getName(self):      def getName(self):

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

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