Changeset 509 for trunk


Ignore:
Timestamp:
08/06/10 15:28:02 (22 months ago)
Author:
gwesche
Message:

Added InternalFormatMode? field to textures. Useful e.g. for texture compression

Location:
trunk/avango-osg
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/avango-osg/include/avango/osg/Texture.h

    r491 r509  
    7171      SFInt MinFilter; 
    7272      SFInt MagFilter; 
     73      SFInt InternalFormatMode; 
    7374      SFFloat MaxAnisotropy; 
    7475      SFBool ResizeNonPowerOfTwoHint; 
     
    9293      virtual void getMagFilterCB(const av::SFInt::GetValueEvent& event); 
    9394      virtual void setMagFilterCB(const av::SFInt::SetValueEvent& event); 
     95      virtual void getInternalFormatModeCB(const av::SFInt::GetValueEvent& event); 
     96      virtual void setInternalFormatModeCB(const av::SFInt::SetValueEvent& event); 
    9497      virtual void getMaxAnisotropyCB(const av::SFFloat::GetValueEvent& event); 
    9598      virtual void setMaxAnisotropyCB(const av::SFFloat::SetValueEvent& event); 
  • trunk/avango-osg/include/avango/osg/TexturedQuad.h

    r341 r509  
    8181      SFInt MinFilter; 
    8282      SFInt MagFilter; 
     83      SFInt InternalFormatMode; 
    8384      SFFloat MaxAnisotropy; 
    8485      SFVec2 TexCoord01; 
     
    120121      virtual void getMagFilterCB(const av::SFInt::GetValueEvent& event); 
    121122      virtual void setMagFilterCB(const av::SFInt::SetValueEvent& event); 
     123      virtual void getInternalFormatModeCB(const av::SFInt::GetValueEvent& event); 
     124      virtual void setInternalFormatModeCB(const av::SFInt::SetValueEvent& event); 
    122125      virtual void getMaxAnisotropyCB(const av::SFFloat::GetValueEvent& event); 
    123126      virtual void setMaxAnisotropyCB(const av::SFFloat::SetValueEvent& event); 
  • trunk/avango-osg/src/avango/osg/Texture.cpp

    r491 r509  
    5959                          boost::bind(&Texture::getMagFilterCB, this, _1), 
    6060                          boost::bind(&Texture::setMagFilterCB, this, _1)); 
     61 
     62  AV_FC_ADD_ADAPTOR_FIELD(InternalFormatMode, 
     63                          boost::bind(&Texture::getInternalFormatModeCB, this, _1), 
     64                          boost::bind(&Texture::setInternalFormatModeCB, this, _1)); 
    6165 
    6266  AV_FC_ADD_ADAPTOR_FIELD(MaxAnisotropy, 
     
    131135 
    132136/* virtual */ void 
     137av::osg::Texture::getInternalFormatModeCB(const av::SFInt::GetValueEvent& event) 
     138{ 
     139  *(event.getValuePtr()) = mOsgTexture->getInternalFormatMode(); 
     140} 
     141 
     142/* virtual */ void 
     143av::osg::Texture::setInternalFormatModeCB(const av::SFInt::SetValueEvent& event) 
     144{ 
     145  mOsgTexture->setInternalFormatMode((::osg::Texture::InternalFormatMode)(event.getValue())); 
     146} 
     147 
     148/* virtual */ void 
    133149av::osg::Texture::getMaxAnisotropyCB(const av::SFFloat::GetValueEvent& event) 
    134150{ 
  • trunk/avango-osg/src/avango/osg/TexturedQuad.cpp

    r341 r509  
    7979                          boost::bind(&TexturedQuad::getMagFilterCB, this, _1), 
    8080                          boost::bind(&TexturedQuad::setMagFilterCB, this, _1)); 
     81 
     82  AV_FC_ADD_ADAPTOR_FIELD(InternalFormatMode, 
     83                          boost::bind(&TexturedQuad::getInternalFormatModeCB, this, _1), 
     84                          boost::bind(&TexturedQuad::setInternalFormatModeCB, this, _1)); 
    8185 
    8286  AV_FC_ADD_ADAPTOR_FIELD(MaxAnisotropy, 
     
    273277 
    274278/* virtual */ void 
     279av::osg::TexturedQuad::getInternalFormatModeCB(const av::SFInt::GetValueEvent& event) 
     280{ 
     281  *(event.getValuePtr()) = Texture2D.getValue()->getOsgTexture2D()->getInternalFormatMode(); 
     282} 
     283 
     284/* virtual */ void 
     285av::osg::TexturedQuad::setInternalFormatModeCB(const av::SFInt::SetValueEvent& event) 
     286{ 
     287  Texture2D.getValue()->getOsgTexture2D()->setInternalFormatMode((::osg::Texture2D::InternalFormatMode)(event.getValue())); 
     288} 
     289 
     290/* virtual */ void 
    275291av::osg::TexturedQuad::getMaxAnisotropyCB(const av::SFFloat::GetValueEvent& event) 
    276292{ 
Note: See TracChangeset for help on using the changeset viewer.