Added TextureRectangle(Image*) contructor.

This commit is contained in:
Robert Osfield
2004-03-09 14:59:33 +00:00
parent a3d99d88ff
commit 9f6383f5dd
4 changed files with 17 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ class SG_EXPORT Texture2D : public Texture
Texture2D();
Texture2D(osg::Image* image);
Texture2D(Image* image);
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Texture2D(const Texture2D& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY);

View File

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

View File

@@ -28,7 +28,7 @@ Texture2D::Texture2D():
setUseHardwareMipMapGeneration(true);
}
Texture2D::Texture2D(osg::Image* image):
Texture2D::Texture2D(Image* image):
_textureWidth(0),
_textureHeight(0),
_numMipmapLevels(0)

View File

@@ -43,6 +43,19 @@ TextureRectangle::TextureRectangle():
setFilter(MAG_FILTER, LINEAR);
}
TextureRectangle::TextureRectangle(Image* image):
_textureWidth(0),
_textureHeight(0)
{
setWrap(WRAP_S, CLAMP);
setWrap(WRAP_T, CLAMP);
setFilter(MIN_FILTER, LINEAR);
setFilter(MAG_FILTER, LINEAR);
setImage(image);
}
TextureRectangle::TextureRectangle(const TextureRectangle& text,const CopyOp& copyop):
Texture(text,copyop),
_image(copyop(text._image.get())),