From Eric Sokolowsky, made a couple of methods static.

This commit is contained in:
Robert Osfield 2006-06-30 13:47:12 +00:00
parent 4ce0d8af64
commit 6a2387373c
2 changed files with 11 additions and 6 deletions

View File

@ -554,6 +554,15 @@ class OSG_EXPORT Texture : public osg::StateAttribute
* on sustems with different graphics pipes. */
static void setExtensions(unsigned int contextID,Extensions* extensions);
/** Determine whether the given internalFormat is a compressed
* image format. */
static bool isCompressedInternalFormat(GLint internalFormat);
/** Determine the size of a compressed image, given the internalFormat,
* the width, the height, and the depth of the image. The block size
* and the size are output parameters. */
static void getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint& blockSize, GLint& size);
/** Helper method. Creates the texture, but doesn't set or use a
* texture binding. Note: Don't call this method directly unless
@ -575,10 +584,6 @@ class OSG_EXPORT Texture : public osg::StateAttribute
void computeRequiredTextureDimensions(State& state, const osg::Image& image,GLsizei& width, GLsizei& height,GLsizei& numMipmapLevels) const;
bool isCompressedInternalFormat(GLint internalFormat) const;
void getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint& blockSize, GLint& size) const;
/** Helper method. Sets texture paramters. */
void applyTexParameters(GLenum target, State& state) const;

View File

@ -599,7 +599,7 @@ bool Texture::isCompressedInternalFormat() const
return isCompressedInternalFormat(getInternalFormat());
}
bool Texture::isCompressedInternalFormat(GLint internalFormat) const
bool Texture::isCompressedInternalFormat(GLint internalFormat)
{
switch(internalFormat)
{
@ -619,7 +619,7 @@ bool Texture::isCompressedInternalFormat(GLint internalFormat) const
}
}
void Texture::getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint& blockSize, GLint& size) const
void Texture::getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint& blockSize, GLint& size)
{
if (internalFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
blockSize = 8;