Added Texture1D(Image*) and Texture3D(Image*) constructors

This commit is contained in:
Robert Osfield 2008-10-08 11:30:18 +00:00
parent a4aa8fbcd2
commit 5e95d6e3b5
4 changed files with 21 additions and 0 deletions

View File

@ -30,6 +30,8 @@ class OSG_EXPORT Texture1D : public Texture
Texture1D(); Texture1D();
Texture1D(Image* image);
/** Copy constructor using CopyOp to manage deep vs shallow copy. */ /** Copy constructor using CopyOp to manage deep vs shallow copy. */
Texture1D(const Texture1D& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY); Texture1D(const Texture1D& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY);

View File

@ -32,6 +32,8 @@ class OSG_EXPORT Texture3D : public Texture
Texture3D(); Texture3D();
Texture3D(Image* image);
/** Copy constructor using CopyOp to manage deep vs shallow copy. */ /** Copy constructor using CopyOp to manage deep vs shallow copy. */
Texture3D(const Texture3D& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY); Texture3D(const Texture3D& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY);

View File

@ -26,6 +26,13 @@ Texture1D::Texture1D():
{ {
} }
Texture1D::Texture1D(osg::Image* image):
_textureWidth(0),
_numMipmapLevels(0)
{
setImage(image);
}
Texture1D::Texture1D(const Texture1D& text,const CopyOp& copyop): Texture1D::Texture1D(const Texture1D& text,const CopyOp& copyop):
Texture(text,copyop), Texture(text,copyop),
_image(copyop(text._image.get())), _image(copyop(text._image.get())),

View File

@ -31,6 +31,16 @@ Texture3D::Texture3D():
{ {
} }
Texture3D::Texture3D(Image* image):
_textureWidth(0),
_textureHeight(0),
_textureDepth(0),
_numMipmapLevels(0)
{
setImage(image);
}
Texture3D::Texture3D(const Texture3D& text,const CopyOp& copyop): Texture3D::Texture3D(const Texture3D& text,const CopyOp& copyop):
Texture(text,copyop), Texture(text,copyop),
_image(copyop(text._image.get())), _image(copyop(text._image.get())),