Skip to content
cjcliffe edited this page Feb 21, 2011 · 4 revisions

CubicVR.Texture

The Texture class provides a container and loader for images. Textures can be applied to a Material or subclasseed for advanced integration such as the case of PJSTexture.

Constructor:


### _Texture( img_path, filter_type )_ **Parameters**: *img_path* - The path to an image, either relative or absolute, i.e. `./images/brick.jpg` or `http://mydomain.com/brick.jpg`. *filter_type* - Filter type to set for this image, see *setFilter* for possible enums.
## Methods:
### _setFilter( filter_type )_ **Purpose**: Set the filter type for the texture (interpolation) **Parameters**: *filter_type* - The filter type to set the texture to, options are one of the following CubicVR.enums:
  • enums.texture.filter.LINEAR
  • enums.texture.filter.LINEAR_MIP
  • enums.texture.filter.NEAREST
  • enums.texture.filter.NEAREST_MIP

default: enums.texture.filter.LINEAR_MIP

Returns:
none


use( texture_unit )

Purpose:
Activate the texture using the given WebGL texture_unit, valid inputs are gl.TEXTURE{x}
Returns:
none


clear()

Purpose:
Clear the texture from it's last use, bind a null in it's place.
Returns:
none


Clone this wiki locally