Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::Texture1D Class Reference

Texture state class which encapsulates OpenGl 1D texture functionality. More...

Inheritance diagram for osg::Texture1D:

Inheritance graph
[legend]
List of all members.

Public Methods

 Texture1D ()
 Texture1D (const Texture1D &text, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.

 META_StateAttribute (osg, Texture1D, TEXTURE)
virtual int compare (const StateAttribute &rhs) const
 return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

virtual void getAssociatedModes (std::vector< GLMode > &modes) const
 return the modes associated with this StateSet

void setImage (Image *image)
 Set the texture image.

Image * getImage ()
 Get the texture image.

const Image * getImage () const
 Get the const texture image.

void setTextureSize (const int width) const
 Set the texture width and height.

void getTextureSize (int &width) const
 Get the texture subload width.

void setSubloadCallback (SubloadCallback *cb)
SubloadCallback * getSubloadCallback ()
const SubloadCallback * getSubloadCallback () const
void setNumMipmapLevels (unsigned int num) const
 Set the number of mip map levels the the texture has been created with, should only be called within an osg::Texuture::apply() and custom OpenGL texture load.

unsigned int getNumMipmapLevels () const
 Get the number of mip map levels the the texture has been created with.

void copyTexImage1D (State &state, int x, int y, int width)
 Copy pixels into a 1D texture image.As per glCopyTexImage1D.

void copyTexSubImage1D (State &state, int xoffset, int x, int y, int width)
 Copy a one-dimensional texture subimage.

virtual void apply (State &state) const
 On first apply (unless already compiled), create the minmapped texture and bind it, subsequent apply will simple bind to texture.


Protected Methods

virtual ~Texture1D ()
virtual void computeInternalFormat () const
void applyTexImage1D (GLenum target, Image *image, State &state, GLsizei &width, GLsizei &numMimpmapLevels) const
 Helper method which does the creation of the texture itself, and does not set or use texture binding.


Protected Attributes

ref_ptr< Image > _image
GLsizei _textureWidth
GLsizei _numMimpmapLevels
ref_ptr< SubloadCallback > _subloadCallback

Detailed Description

Texture state class which encapsulates OpenGl 1D texture functionality.


Constructor & Destructor Documentation

osg::Texture1D::Texture1D (    ) 
 

osg::Texture1D::Texture1D (  const Texture1D &    text,
const CopyOp &    copyop = CopyOp::SHALLOW_COPY
) 
 

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::Texture1D::~Texture1D (    )  [protected, virtual]
 


Member Function Documentation

virtual void osg::Texture1D::apply (  State &    state )  const [virtual]
 

On first apply (unless already compiled), create the minmapped texture and bind it, subsequent apply will simple bind to texture.

Implements osg::Texture.

void osg::Texture1D::applyTexImage1D (  GLenum    target,
Image *    image,
State &    state,
GLsizei &    width,
GLsizei &    numMimpmapLevels
)  const [protected]
 

Helper method which does the creation of the texture itself, and does not set or use texture binding.

virtual int osg::Texture1D::compare (  const StateAttribute &    rhs )  const [virtual]
 

return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

Implements osg::StateAttribute.

virtual void osg::Texture1D::computeInternalFormat (    )  const [protected, virtual]
 

Implements osg::Texture.

void osg::Texture1D::copyTexImage1D (  State &    state,
int    x,
int    y,
int    width
) 
 

Copy pixels into a 1D texture image.As per glCopyTexImage1D.

Creates an OpenGL texture object from the current OpenGL background framebuffer contents at pos x, y with width width. width must be a power of two.

void osg::Texture1D::copyTexSubImage1D (  State &    state,
int    xoffset,
int    x,
int    y,
int    width
) 
 

Copy a one-dimensional texture subimage.

As per glCopyTexSubImage1D. Updates portion of an existing OpenGL texture object from the current OpenGL background framebuffer contents at pos x, y with width width.

virtual void osg::Texture1D::getAssociatedModes (  std::vector< GLMode > &    modes )  const [inline, virtual]
 

return the modes associated with this StateSet

Reimplemented from osg::StateAttribute.

const Image* osg::Texture1D::getImage (    )  const [inline]
 

Get the const texture image.

Image* osg::Texture1D::getImage (    )  [inline]
 

Get the texture image.

unsigned int osg::Texture1D::getNumMipmapLevels (    )  const [inline]
 

Get the number of mip map levels the the texture has been created with.

const SubloadCallback* osg::Texture1D::getSubloadCallback (    )  const [inline]
 

SubloadCallback* osg::Texture1D::getSubloadCallback (    )  [inline]
 

void osg::Texture1D::getTextureSize (  int &    width )  const [inline]
 

Get the texture subload width.

osg::Texture1D::META_StateAttribute (  osg   ,
Texture1D   ,
TEXTURE   
) 
 

void osg::Texture1D::setImage (  Image *    image ) 
 

Set the texture image.

void osg::Texture1D::setNumMipmapLevels (  unsigned int    num )  const [inline]
 

Set the number of mip map levels the the texture has been created with, should only be called within an osg::Texuture::apply() and custom OpenGL texture load.

void osg::Texture1D::setSubloadCallback (  SubloadCallback *    cb )  [inline]
 

void osg::Texture1D::setTextureSize (  const int    width )  const [inline]
 

Set the texture width and height.

If width or height are zero then the repsective size value is calculated from the source image sizes.


Member Data Documentation

ref_ptr<Image> osg::Texture1D::_image [protected]
 

GLsizei osg::Texture1D::_numMimpmapLevels [protected]
 

ref_ptr<SubloadCallback> osg::Texture1D::_subloadCallback [protected]
 

GLsizei osg::Texture1D::_textureWidth [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:45 2002 for the Open Scene Graph by doxygen 1.2.16.