From 6a2387373c6b8be86a4f61592ce7a7ef3b2491cc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 30 Jun 2006 13:47:12 +0000 Subject: [PATCH] From Eric Sokolowsky, made a couple of methods static. --- include/osg/Texture | 13 +++++++++---- src/osg/Texture.cpp | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/osg/Texture b/include/osg/Texture index 9537c363b..c8975694c 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -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; diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index df5345e69..e58e550ed 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -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;