Further work on trying to get glGenerateMipMapEXT working in conjunction with
frame buffer objects. Still don't work under Linux yet through :-|
This commit is contained in:
@@ -263,6 +263,7 @@ namespace osg
|
||||
|
||||
FrameBufferAttachment &operator = (const FrameBufferAttachment ©);
|
||||
|
||||
void createRequiredTexturesAndApplyGenerateMipMap(State &state, const FBOExtensions* ext) const;
|
||||
void attach(State &state, GLenum attachment_point, const FBOExtensions* ext) const;
|
||||
int compare(const FrameBufferAttachment &fa) const;
|
||||
|
||||
|
||||
@@ -207,6 +207,15 @@ class OSG_EXPORT Texture : public osg::StateAttribute
|
||||
|
||||
virtual bool isTextureAttribute() const { return true; }
|
||||
|
||||
|
||||
virtual GLenum getTextureTarget() const = 0;
|
||||
|
||||
virtual bool getModeUsage(ModeUsage& usage) const
|
||||
{
|
||||
usage.usesTextureMode(getTextureTarget());
|
||||
return true;
|
||||
}
|
||||
|
||||
enum WrapParameter {
|
||||
WRAP_S,
|
||||
WRAP_T,
|
||||
|
||||
@@ -38,11 +38,7 @@ class OSG_EXPORT Texture1D : public Texture
|
||||
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
||||
virtual int compare(const StateAttribute& rhs) const;
|
||||
|
||||
virtual bool getModeUsage(ModeUsage& usage) const
|
||||
{
|
||||
usage.usesTextureMode(GL_TEXTURE_1D);
|
||||
return true;
|
||||
}
|
||||
virtual GLenum getTextureTarget() const { return GL_TEXTURE_1D; }
|
||||
|
||||
/** Sets the texture image. */
|
||||
void setImage(Image* image);
|
||||
|
||||
@@ -38,11 +38,7 @@ class OSG_EXPORT Texture2D : public Texture
|
||||
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
||||
virtual int compare(const StateAttribute& rhs) const;
|
||||
|
||||
virtual bool getModeUsage(ModeUsage& usage) const
|
||||
{
|
||||
usage.usesTextureMode(GL_TEXTURE_2D);
|
||||
return true;
|
||||
}
|
||||
virtual GLenum getTextureTarget() const { return GL_TEXTURE_2D; }
|
||||
|
||||
/** Sets the texture image. */
|
||||
void setImage(Image* image);
|
||||
|
||||
@@ -36,11 +36,7 @@ class OSG_EXPORT Texture3D : public Texture
|
||||
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
||||
virtual int compare(const StateAttribute& rhs) const;
|
||||
|
||||
virtual bool getModeUsage(ModeUsage& usage) const
|
||||
{
|
||||
usage.usesTextureMode(GL_TEXTURE_3D);
|
||||
return true;
|
||||
}
|
||||
virtual GLenum getTextureTarget() const { return GL_TEXTURE_3D; }
|
||||
|
||||
/** Sets the texture image. */
|
||||
void setImage(Image* image);
|
||||
|
||||
@@ -47,11 +47,7 @@ class OSG_EXPORT TextureCubeMap : public Texture
|
||||
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
||||
virtual int compare(const StateAttribute& rhs) const;
|
||||
|
||||
virtual bool getModeUsage(ModeUsage& usage) const
|
||||
{
|
||||
usage.usesTextureMode(GL_TEXTURE_CUBE_MAP);
|
||||
return true;
|
||||
}
|
||||
virtual GLenum getTextureTarget() const { return GL_TEXTURE_CUBE_MAP; }
|
||||
|
||||
enum Face {
|
||||
POSITIVE_X=0,
|
||||
|
||||
@@ -44,11 +44,7 @@ class OSG_EXPORT TextureRectangle : public Texture
|
||||
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
||||
virtual int compare(const StateAttribute& rhs) const;
|
||||
|
||||
virtual bool getModeUsage(ModeUsage& usage) const
|
||||
{
|
||||
usage.usesTextureMode(GL_TEXTURE_RECTANGLE);
|
||||
return true;
|
||||
}
|
||||
virtual GLenum getTextureTarget() const { return GL_TEXTURE_RECTANGLE; }
|
||||
|
||||
/** Set the texture image. */
|
||||
void setImage(Image* image);
|
||||
|
||||
Reference in New Issue
Block a user