Show
Ignore:
Timestamp:
06/12/07 16:20:16 (8 years ago)
Author:
robert
Message:

From Martin Lavery and Robert Osfield, Updated examples to use a variation of the MIT License

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp

    r6935 r6941  
    1 // -*-c++-*- 
     1/* OpenSceneGraph example, osgmovie. 
     2* 
     3*  Permission is hereby granted, free of charge, to any person obtaining a copy 
     4*  of this software and associated documentation files (the "Software"), to deal 
     5*  in the Software without restriction, including without limitation the rights 
     6*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
     7*  copies of the Software, and to permit persons to whom the Software is 
     8*  furnished to do so, subject to the following conditions: 
     9* 
     10*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
     11*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
     12*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
     13*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
     14*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
     15*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
     16*  THE SOFTWARE. 
     17*/ 
    218 
    319#include <osgViewer/Viewer> 
     
    260276                                           0.0f,image->t(), image->s(),0.0f); 
    261277 
     278        osg::TextureRectangle* texture = new osg::TextureRectangle(image); 
     279        texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); 
     280        texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE); 
     281         
     282         
    262283        pictureQuad->getOrCreateStateSet()->setTextureAttributeAndModes(0, 
    263                     new osg::TextureRectangle(image), 
    264                     osg::StateAttribute::ON); 
    265                      
     284                                                                        texture, 
     285                                                                        osg::StateAttribute::ON); 
     286         
    266287        return pictureQuad; 
    267288    } 
     
    274295                                     
    275296        osg::Texture2D* texture = new osg::Texture2D(image); 
    276         texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR);   
    277                                         
     297        texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR); 
     298        texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); 
     299        texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE); 
     300         
     301         
    278302        pictureQuad->getOrCreateStateSet()->setTextureAttributeAndModes(0, 
    279303                    texture,