Texture2DMultisample
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Texture2DMultisample codes Copyright (C) 2010 Marcin Hajder
* Thanks to to my company http://www.ai.com.pl for allowing me free this work.
*/
#ifndef OSG_TEXTURE2DMS
#define OSG_TEXTURE2DMS 1
#include <osg/Texture>
namespace osg {
class OSG_EXPORT Texture2DMultisample : public Texture
{
public :
Texture2DMultisample();
Texture2DMultisample(GLsizei numSamples, GLboolean fixedsamplelocations);
Texture2DMultisample(const Texture2DMultisample& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_StateAttribute(osg, Texture2DMultisample,TEXTURE);
virtual int compare(const StateAttribute& rhs) const;
virtual GLenum getTextureTarget() const
{
return GL_TEXTURE_2D_MULTISAMPLE;
}
virtual bool getModeUsage(StateAttribute::ModeUsage&) const { return false; }
inline void setTextureSize(int width, int height) const
{
_textureWidth = width;
_textureHeight = height;
}
inline void setNumSamples( int samples ) { _numSamples = samples; }
GLsizei getNumSamples() const { return _numSamples; }
inline void setFixedSampleLocations( GLboolean fixedSampleLocations ) { _fixedsamplelocations = fixedSampleLocations; }
inline GLboolean getFixedSampleLocations() const { return _fixedsamplelocations; }
// unnecessary for Texture2DMultisample
virtual void setImage(unsigned int /*face*/, Image* /*image*/) {}
virtual Image* getImage(unsigned int /*face*/) { return NULL; }
virtual const Image* getImage(unsigned int /*face*/) const { return NULL; }
virtual unsigned int getNumImages() const {return 0; }
virtual void allocateMipmap(State& /*state*/) const {}
void setTextureWidth(int width) { _textureWidth=width; }
void setTextureHeight(int height) { _textureHeight=height; }
virtual int getTextureWidth() const { return _textureWidth; }
virtual int getTextureHeight() const { return _textureHeight; }
virtual int getTextureDepth() const { return 1; }
virtual void apply(State& state) const;
protected :
virtual ~Texture2DMultisample();
virtual void computeInternalFormat() const;
mutable GLsizei _textureWidth, _textureHeight;
mutable GLsizei _numSamples;
mutable GLboolean _fixedsamplelocations;
};
}
#endif
Texture
GL_TEXTURE_2D_MULTISAMPLE
#define GL_TEXTURE_2D_MULTISAMPLE
Definition Texture:236
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Image
Definition Image:179
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::TEXTURE
@ TEXTURE
Definition StateAttribute:125
osg::State
Definition State:80
osg::Texture2DMultisample::getTextureTarget
virtual GLenum getTextureTarget() const
Definition Texture2DMultisample:45
osg::Texture2DMultisample::getTextureWidth
virtual int getTextureWidth() const
Definition Texture2DMultisample:78
osg::Texture2DMultisample::_textureWidth
GLsizei _textureWidth
Definition Texture2DMultisample:93
osg::Texture2DMultisample::~Texture2DMultisample
virtual ~Texture2DMultisample()
osg::Texture2DMultisample::META_StateAttribute
META_StateAttribute(osg, Texture2DMultisample, TEXTURE)
osg::Texture2DMultisample::setTextureHeight
void setTextureHeight(int height)
Definition Texture2DMultisample:76
osg::Texture2DMultisample::getNumImages
virtual unsigned int getNumImages() const
Definition Texture2DMultisample:72
osg::Texture2DMultisample::setTextureWidth
void setTextureWidth(int width)
Definition Texture2DMultisample:75
osg::Texture2DMultisample::getModeUsage
virtual bool getModeUsage(StateAttribute::ModeUsage &) const
Definition Texture2DMultisample:51
osg::Texture2DMultisample::apply
virtual void apply(State &state) const
osg::Texture2DMultisample::computeInternalFormat
virtual void computeInternalFormat() const
osg::Texture2DMultisample::_fixedsamplelocations
GLboolean _fixedsamplelocations
Definition Texture2DMultisample:97
osg::Texture2DMultisample::setTextureSize
void setTextureSize(int width, int height) const
Definition Texture2DMultisample:55
osg::Texture2DMultisample::getImage
virtual const Image * getImage(unsigned int) const
Definition Texture2DMultisample:71
osg::Texture2DMultisample::setNumSamples
void setNumSamples(int samples)
Definition Texture2DMultisample:61
osg::Texture2DMultisample::_numSamples
GLsizei _numSamples
Definition Texture2DMultisample:95
osg::Texture2DMultisample::setImage
virtual void setImage(unsigned int, Image *)
Definition Texture2DMultisample:68
osg::Texture2DMultisample::_textureHeight
GLsizei _textureHeight
Definition Texture2DMultisample:93
osg::Texture2DMultisample::allocateMipmap
virtual void allocateMipmap(State &) const
Definition Texture2DMultisample:73
osg::Texture2DMultisample::getImage
virtual Image * getImage(unsigned int)
Definition Texture2DMultisample:70
osg::Texture2DMultisample::compare
virtual int compare(const StateAttribute &rhs) const
osg::Texture2DMultisample::getTextureDepth
virtual int getTextureDepth() const
Definition Texture2DMultisample:80
osg::Texture2DMultisample::setFixedSampleLocations
void setFixedSampleLocations(GLboolean fixedSampleLocations)
Definition Texture2DMultisample:64
osg::Texture2DMultisample::Texture2DMultisample
Texture2DMultisample()
osg::Texture2DMultisample::Texture2DMultisample
Texture2DMultisample(const Texture2DMultisample &text, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
osg::Texture2DMultisample::Texture2DMultisample
Texture2DMultisample(GLsizei numSamples, GLboolean fixedsamplelocations)
osg::Texture2DMultisample::getTextureHeight
virtual int getTextureHeight() const
Definition Texture2DMultisample:79
osg::Texture2DMultisample::getFixedSampleLocations
GLboolean getFixedSampleLocations() const
Definition Texture2DMultisample:65
osg::Texture2DMultisample::getNumSamples
GLsizei getNumSamples() const
Definition Texture2DMultisample:62
osg::Texture::Texture
Texture()
osg
Definition AlphaFunc:19
NULL
#define NULL
Definition osg/Export:55
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39
osg::StateAttribute::ModeUsage
Definition StateAttribute:308