Changeset 12986

Show
Ignore:
Timestamp:
02/20/12 13:03:14 (3 years ago)
Author:
robert
Message:

From Johannes Baeurele, "The osg::Image class now contains a 'supportsTextureSubloading()' method that is used inside the Texture2D::apply method. For now it only checks for the etc1 format in which case it returns 'false'. All other formats lead to a return value of 'true'.

Without the change the application does not work properly. First I get the notification that an OpenGL error occured. After some more of this error messages I see broken textures on the screen. With the changes attached to this message my application works as intended."

Note from Robert Osfield, changed the Image::supportsTextureSubloading() to be const and to be implemented in the .cpp rather than inline.

Location:
OpenSceneGraph/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/Image

    r12979 r12986  
    9393#endif 
    9494 
     95#ifndef GL_OES_compressed_ETC1_RGB8_texture 
     96    #define GL_ETC1_RGB8_OES        0x8D64    
     97#endif 
     98 
    9599namespace osg { 
    96100 
     
    397401        } 
    398402 
     403        /** returns false for texture formats that do not support texture subloading */ 
     404        bool supportsTextureSubloading() const; 
     405 
    399406        /** Return true if this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized). */ 
    400407        virtual bool isImageTranslucent() const; 
  • OpenSceneGraph/trunk/src/osg/Image.cpp

    r12979 r12986  
    14321432} 
    14331433 
     1434bool Image::supportsTextureSubloading() const 
     1435{ 
     1436    switch(_internalTextureFormat) 
     1437    { 
     1438        case GL_ETC1_RGB8_OES: 
     1439            return false; 
     1440        default: 
     1441            return true; 
     1442    } 
     1443} 
     1444 
    14341445 
    14351446template <typename T>     
  • OpenSceneGraph/trunk/src/osg/Texture2D.cpp

    r12442 r12986  
    248248        applyTexParameters(GL_TEXTURE_2D,state); 
    249249 
    250         if (textureObject->isAllocated()) 
     250        if (textureObject->isAllocated() && image->supportsTextureSubloading()) 
    251251        { 
    252252            //OSG_NOTICE<<"Reusing texture object"<<std::endl;