Module Texture :: Class Texture
[show private | hide private]
[frames | no frames]

Class Texture


Represents an OpenGL texture, optionally loaded from disk in any format supported by PIL
Method Summary
  __init__(self, name, target)
  __del__(self)
  bind(self, glTarget)
Bind this texture to self.glTarget in the current OpenGL context
  loadFile(self, name)
Load the texture from disk, using PIL to open the file
  loadImage(self, image)
Load the texture from a PIL image
  loadRaw(self, size, string, format, components)
Load a raw image from the given string.
  loadSurface(self, surface, monochrome, alphaChannel)
Load the texture from a pygame surface
  nextPowerOfTwo(self, n)
  prepareRenderTarget(self, width, height, generateMipmap)
  resetDefaultRenderTarget(self)
  setAsRenderTarget(self)
  setDefaults(self)
Set the default OpenGL options for this texture
  setFilter(self, min, mag)
  setRepeat(self, u, v)

Method Details

bind(self, glTarget=None)

Bind this texture to self.glTarget in the current OpenGL context

loadFile(self, name)

Load the texture from disk, using PIL to open the file

loadImage(self, image)

Load the texture from a PIL image

loadRaw(self, size, string, format, components)

Load a raw image from the given string. 'format' is a constant such as GL_RGB or GL_RGBA that can be passed to gluBuild2DMipmaps.

loadSurface(self, surface, monochrome=False, alphaChannel=False)

Load the texture from a pygame surface

setDefaults(self)

Set the default OpenGL options for this texture

Generated by Epydoc 2.1 on Thu Aug 31 00:17:50 2006 http://epydoc.sf.net