Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::graphics::devices::opengl::OpenGLTexture Class Reference

A class that represents an image stored on the graphics hardware. More...

#include <omGraphicsOpenGLTexture.h>

Inheritance diagram for om::graphics::devices::opengl::OpenGLTexture:
om::graphics::textures::DeviceTexture om::graphics::devices::DeviceResource

Public Member Functions

 ~OpenGLTexture ()
 Destroy a texture and all resources associated with it. More...
 
virtual Size getDimensionCount () const
 Return the number of dimensions in this texture, usually 1, 2, or 3. More...
 
virtual Size getSize (Index dimension) const
 Return the size of the texture along the specified dimension index. More...
 
virtual Size getFaceCount () const
 Return the number of faces that this texture has. More...
 
virtual Bool isCube () const
 Return whether or not this texture is a cube map texture. More...
 
virtual TextureFormat getFormat () const
 Return a object that represents the internal storage format for the texture. More...
 
virtual Bool getFace (Image &image, const PixelFormat &pixelType, TextureFace face=TextureFace::FRONT, Index mipmapLevel=0) const
 Get the texture's image data for the specified face index with the data in the specified pixel type. More...
 
virtual Bool setFace (const Image &newImage, TextureFormat newTextureFormat, TextureFace face=TextureFace::FRONT, Index mipmapLevel=0)
 Replace the current contents of the texture with the specified image. More...
 
virtual Bool updateFace (const Image &newImage, const Vector3i &position=Vector3i(), TextureFace face=TextureFace::FRONT, Index mipmapLevel=0)
 Update a region of the texture with the specified image. More...
 
virtual Bool clearFace (Float channelColor, TextureFace face=TextureFace::FRONT, Index mipmapLevel=0)
 Clear this texture's image using the specified clear color component for the given face and mipmap level. More...
 
virtual TextureWrapType getWrapType () const
 Return the type of texture wrapping to do when texture coordinates are outside of the range [0,1]. More...
 
virtual Bool setWrapType (const TextureWrapType &newWrapType)
 Set the type of texture wrapping to do when texture coordinates are outside of the range [0,1]. More...
 
virtual TextureFilter getDownsampleFilter () const
 Return the type of texture filtering that is used when the texture is reduced in size. More...
 
virtual Bool setDownsampleFilter (const TextureFilter &newDownsampleFilter)
 Set the type of texture filtering that is used when the texture is reduced in size. More...
 
virtual TextureFilter getUpsampleFilter () const
 Return the type of texture filtering that is used when the texture is increased in size. More...
 
virtual Bool setUpsampleFilter (const TextureFilter &newUpsampleFilter)
 Set the type of texture filtering that is used when the texture is increased in size. More...
 
virtual Size getMipmapCount () const
 Return the number of mipmap levels that this texture has. More...
 
virtual Bool generateMipmaps ()
 Generate smaller mipmaps of the texture from the largest texture image (level 0). More...
 
virtual Bool isResident () const
 Return whether or not the texture is currently in memory on the GPU. More...
 
virtual Bool isValid () const
 Return whether or not the state of this texture is valid and able to be used for rendering. More...
 
OpenGLID getID () const
 Get a unique OpenGL integer identifier for this texture. More...
 
- Public Member Functions inherited from om::graphics::textures::DeviceTexture
Bool isValidFace (const TextureFace &face) const
 Return whether or not the specified face is valid for this texture. More...
 
- Public Member Functions inherited from om::graphics::devices::DeviceResource
virtual ~DeviceResource ()
 Destroy a device object, releasing all internal state. More...
 
GraphicsContextgetContext () const
 Return a pointer to the graphics context associated with this DeviceResource. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::graphics::textures::DeviceTexture
 DeviceTexture (devices::GraphicsContext *context)
 Create an empty texture for the given context with no face images. More...
 
- Protected Member Functions inherited from om::graphics::devices::DeviceResource
 DeviceResource (GraphicsContext *newContext)
 Create a new device object that is associated with the specified graphics context. More...
 

Detailed Description

A class that represents an image stored on the graphics hardware.

A texture can be either 1D, 2D, 3D, or a cube map (six 2D faces), with any common texture format (Alpha, Gray, RGB, RGBA, etc.).

Constructor & Destructor Documentation

om::graphics::devices::opengl::OpenGLTexture::~OpenGLTexture ( )

Destroy a texture and all resources associated with it.

Member Function Documentation

virtual Size om::graphics::devices::opengl::OpenGLTexture::getDimensionCount ( ) const
virtual

Return the number of dimensions in this texture, usually 1, 2, or 3.

Implements om::graphics::textures::DeviceTexture.

virtual Size om::graphics::devices::opengl::OpenGLTexture::getSize ( Index  dimension) const
virtual

Return the size of the texture along the specified dimension index.

Implements om::graphics::textures::DeviceTexture.

virtual Size om::graphics::devices::opengl::OpenGLTexture::getFaceCount ( ) const
virtual

Return the number of faces that this texture has.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::isCube ( ) const
virtual

Return whether or not this texture is a cube map texture.

Implements om::graphics::textures::DeviceTexture.

virtual TextureFormat om::graphics::devices::opengl::OpenGLTexture::getFormat ( ) const
virtual

Return a object that represents the internal storage format for the texture.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::getFace ( Image &  image,
const PixelFormat &  pixelType,
TextureFace  face = TextureFace::FRONT,
Index  mipmapLevel = 0 
) const
virtual

Get the texture's image data for the specified face index with the data in the specified pixel type.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::setFace ( const Image &  newImage,
TextureFormat  newTextureFormat,
TextureFace  face = TextureFace::FRONT,
Index  mipmapLevel = 0 
)
virtual

Replace the current contents of the texture with the specified image.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::updateFace ( const Image &  newImage,
const Vector3i position = Vector3i(),
TextureFace  face = TextureFace::FRONT,
Index  mipmapLevel = 0 
)
virtual

Update a region of the texture with the specified image.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::clearFace ( Float  channelColor,
TextureFace  face = TextureFace::FRONT,
Index  mipmapLevel = 0 
)
virtual

Clear this texture's image using the specified clear color component for the given face and mipmap level.

Implements om::graphics::textures::DeviceTexture.

virtual TextureWrapType om::graphics::devices::opengl::OpenGLTexture::getWrapType ( ) const
virtual

Return the type of texture wrapping to do when texture coordinates are outside of the range [0,1].

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::setWrapType ( const TextureWrapType newWrapType)
virtual

Set the type of texture wrapping to do when texture coordinates are outside of the range [0,1].

Implements om::graphics::textures::DeviceTexture.

virtual TextureFilter om::graphics::devices::opengl::OpenGLTexture::getDownsampleFilter ( ) const
virtual

Return the type of texture filtering that is used when the texture is reduced in size.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::setDownsampleFilter ( const TextureFilter newDownsampleFilter)
virtual

Set the type of texture filtering that is used when the texture is reduced in size.

Implements om::graphics::textures::DeviceTexture.

virtual TextureFilter om::graphics::devices::opengl::OpenGLTexture::getUpsampleFilter ( ) const
virtual

Return the type of texture filtering that is used when the texture is increased in size.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::setUpsampleFilter ( const TextureFilter newUpsampleFilter)
virtual

Set the type of texture filtering that is used when the texture is increased in size.

Implements om::graphics::textures::DeviceTexture.

virtual Size om::graphics::devices::opengl::OpenGLTexture::getMipmapCount ( ) const
virtual

Return the number of mipmap levels that this texture has.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::generateMipmaps ( )
virtual

Generate smaller mipmaps of the texture from the largest texture image (level 0).

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::isResident ( ) const
virtual

Return whether or not the texture is currently in memory on the GPU.

Implements om::graphics::textures::DeviceTexture.

virtual Bool om::graphics::devices::opengl::OpenGLTexture::isValid ( ) const
virtual

Return whether or not the state of this texture is valid and able to be used for rendering.

Implements om::graphics::devices::DeviceResource.

OpenGLID om::graphics::devices::opengl::OpenGLTexture::getID ( ) const
inline

Get a unique OpenGL integer identifier for this texture.


The documentation for this class was generated from the following file: