|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions
gameplay::Texture::Sampler Class Reference

`#include <Texture.h>`

Inheritance diagram for gameplay::Texture::Sampler:

List of all members.

## Public Member Functions

virtual | ~Sampler ()
void | setWrapMode (Wrap wrapS, Wrap wrapT, Wrap wrapR=REPEAT)
void | setFilterMode (Filter minificationFilter, Filter magnificationFilter)
Texture * | getTexture () const
void | bind ()

## Static Public Member Functions

static Sampler * | create (Texture *texture)
static Sampler * | create (const char *path, bool generateMipmaps=false)

## Detailed Description

Defines a texture sampler.

A texture sampler is basically an instance of a texture that can be used to sample a texture from a material. In addition to the texture itself, a sampler stores per-instance texture state information, such as wrap and filter modes.

## Constructor & Destructor Documentation

virtual gameplay::Texture::Sampler::~Sampler | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

void gameplay::Texture::Sampler::bind | ( |  | ) |

Binds the texture of this sampler to the renderer and applies the sampler state.

static Sampler* gameplay::Texture::Sampler::create | ( | Texture * | texture | ) | `[static]`

Creates a sampler for the specified texture.

Parameters:

  texture | The texture.

Returns:
  The new sampler.

static Sampler* gameplay::Texture::Sampler::create | ( | const char * | path,
|  | bool | generateMipmaps = `false`
| ) |  | `[static]`

Creates a sampler for the specified texture.

Parameters:

  path | Path to the texture to create a sampler for.
  generateMipmaps | True to force a full mipmap chain to be generated for the texture, false otherwise.

Returns:
  The new sampler.

Texture* gameplay::Texture::Sampler::getTexture | ( |  | ) | const

Gets the texture for this sampler.

Returns:
  The texture for this sampler.

void gameplay::Texture::Sampler::setFilterMode | ( | Filter | minificationFilter,
|  | Filter | magnificationFilter
| ) |  |

Sets the texture filter modes for this sampler.

Parameters:

  minificationFilter | The texture minification filter.
  magnificationFilter | The texture magnification filter.

void gameplay::Texture::Sampler::setWrapMode | ( | Wrap | wrapS,
|  | Wrap | wrapT,
|  | Wrap | wrapR = `REPEAT`
| ) |  |

Sets the wrap mode for this sampler.

Parameters:

  wrapS | The horizontal wrap mode.
  wrapT | The vertical wrap mode.
  wrapR | The depth wrap mode.

All Classes Functions Variables Typedefs Enumerations Enumerator