ork::Texture Class Reference
[render]

An abstract texture. More...

#include <Texture.h>

Inheritance diagram for ork::Texture:
ork::Object ork::Texture1D ork::Texture1DArray ork::Texture2D ork::Texture2DArray ork::Texture2DMultisample ork::Texture2DMultisampleArray ork::Texture3D ork::TextureBuffer ork::TextureCube ork::TextureCubeArray ork::TextureRectangle

List of all members.

Classes

class  Parameters
 A set of texture parameters. More...

Public Member Functions

virtual ~Texture ()
 Destroys this texture.
GLuint getId () const
 Returns the identifier of this texture.
unsigned int getComponents () const
 Returns the number of components in the texture's internal format.
const char * getInternalFormatName () const
 Returns the name of the texture's internal format.
TextureInternalFormat getInternalFormat () const
 Returns the internal format of this texture.
TextureFormat getFormat () const
 Returns a Format compatible with the internal format of this Texture.
bool hasMipmaps () const
 True if this texture has any mipmap level above 0.
bool isCompressed () const
 Returns true if this texture is in a compressed format on GPU.
GLsizei getCompressedSize (int level) const
 Returns the size of the compressed data of this texture.
void getImage (int level, TextureFormat f, PixelType t, void *pixels)
 Returns the texture pixels in the specified format.
void getCompressedImage (int level, void *pixels) const
 Returns the compressed data of this texture.
void generateMipMap ()
 Generates the mipmap levels for this texture.

Protected Member Functions

 Texture (const char *type, int target)
 Creates a new unitialized texture.
void init (TextureInternalFormat tf, const Parameters &params)
 Initializes this texture.
GLint bindToTextureUnit (ptr< Sampler > s, GLuint programId) const
 Binds this texture and the given sampler to a texture unit, for the given program.
GLint bindToTextureUnit () const
 Binds this texture to a texture unit.
virtual void swap (ptr< Texture > t)
 Swaps this texture with the given one.

Detailed Description

An abstract texture.


Constructor & Destructor Documentation

virtual ork::Texture::~Texture (  )  [virtual]

Destroys this texture.

ork::Texture::Texture ( const char *  type,
int  target 
) [protected]

Creates a new unitialized texture.

Parameters:
type the texture class name.
target a texture type (1D, 2D, 3D, etc).

Member Function Documentation

GLint ork::Texture::bindToTextureUnit (  )  const [protected]

Binds this texture to a texture unit.

If there is a texture unit to which no texture is currently bound the texture is bound to this unit. Otherwise the least recently used texture unit is unbound, and this texture is bound instead.

Returns:
the texture unit to which the texture has been bound.
GLint ork::Texture::bindToTextureUnit ( ptr< Sampler s,
GLuint  programId 
) const [protected]

Binds this texture and the given sampler to a texture unit, for the given program.

If there is a texture unit to which no texture is currently bound the texture is bound to this unit. Otherwise the least recently used texture unit that is not used by the given program is unbound, and this texture is bound instead.

Parameters:
s a sampler object to sample this texture. May be NULL.
programId the program for which this texture must be bound.
Returns:
the texture unit to which the texture has been bound, or -1 if the binding failed (all units already used by the program).
void ork::Texture::generateMipMap (  ) 

Generates the mipmap levels for this texture.

unsigned int ork::Texture::getComponents (  )  const

Returns the number of components in the texture's internal format.

void ork::Texture::getCompressedImage ( int  level,
void *  pixels 
) const

Returns the compressed data of this texture.

Must be used only for a compressed texture (see isCompressed).

Parameters:
level the texture LOD level to be read.
[out] pixels the returned compressed data.
GLsizei ork::Texture::getCompressedSize ( int  level  )  const

Returns the size of the compressed data of this texture.

Must be used only for a compressed texture (see isCompressed).

TextureFormat ork::Texture::getFormat (  )  const

Returns a Format compatible with the internal format of this Texture.

GLuint ork::Texture::getId (  )  const

Returns the identifier of this texture.

void ork::Texture::getImage ( int  level,
TextureFormat  f,
PixelType  t,
void *  pixels 
)

Returns the texture pixels in the specified format.

Parameters:
level the texture LOD level to be read.
f the format in which data must be returned.
t the type in which pixel components must be returned.
[out] pixels the returned data.
TextureInternalFormat ork::Texture::getInternalFormat (  )  const

Returns the internal format of this texture.

const char* ork::Texture::getInternalFormatName (  )  const

Returns the name of the texture's internal format.

bool ork::Texture::hasMipmaps (  )  const

True if this texture has any mipmap level above 0.

False if this texture has only a base level.

void ork::Texture::init ( TextureInternalFormat  tf,
const Parameters params 
) [protected]

Initializes this texture.

Parameters:
tf texture data format on GPU.
params the texture parameters.
bool ork::Texture::isCompressed (  )  const

Returns true if this texture is in a compressed format on GPU.

virtual void ork::Texture::swap ( ptr< Texture t  )  [protected, virtual]

Swaps this texture with the given one.


Generated on Mon Oct 18 09:36:09 2010 for ork by  doxygen 1.6.1