Commit 81c64638 authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[CHANGE] Changed return type of getTexture to WGETexture2D instead of osg::Texture2d.

parent 99a566eb
......@@ -24,8 +24,7 @@
#include <utility>
#include <osg/Texture2D>
#include <core/graphicsEngine/WGETexture.h>
#include "WAssert.h"
#include "WHistogram2D.h"
#include "WLimits.h"
......@@ -120,7 +119,7 @@ void WHistogram2D::insert( double x, double y )
insert( values );
}
osg::ref_ptr< osg::Texture2D > WHistogram2D::getTexture()
WGETexture2D::RPtr WHistogram2D::getTexture()
{
osg::ref_ptr< osg::Image > image = new osg::Image();
size_t imageWidth = m_buckets[0];
......@@ -150,5 +149,6 @@ osg::ref_ptr< osg::Texture2D > WHistogram2D::getTexture()
data[i + j * imageWidth] = static_cast< float >( m_bins( i, j ) ) / maxCount;
}
}
return new osg::Texture2D( image );
;
return WGETexture2D::RPtr( new WGETexture2D( image ) );
}
......@@ -31,7 +31,7 @@
#include <Eigen/Core>
#include <osg/Texture2D>
#include <core/graphicsEngine/WGETexture.h>
#include "WHistogramND.h"
......@@ -126,11 +126,11 @@ public:
void insert( double x, double y );
/**
* Copy-convert this into an OSG texture.
* Copy-convert this into a texture.
*
* \return osg::Texture2D representing this histogram.
* \return \c osg::ref_ptr to the two-dimensional texture.
*/
osg::ref_ptr< osg::Texture2D > getTexture();
WGETexture2D::RPtr getTexture();
protected:
private:
......
......@@ -53,6 +53,11 @@ template < typename TextureType = osg::Texture >
class WGETexture: public TextureType
{
public:
/**
* Convenience type for OSG reference pointer on WGETextures.
*/
typedef osg::ref_ptr< WGETexture< TextureType > > RPtr;
//! We support only 8 textures because some known hardware does not support more texture coordinates.
static std::size_t const MAX_NUMBER_OF_TEXTURES = 8;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment