Show
Ignore:
Timestamp:
03/21/12 18:36:20 (2 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osg/TextureRectangle.cpp

    r12993 r13041  
    11/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    5757    setFilter(MIN_FILTER, LINEAR); 
    5858    setFilter(MAG_FILTER, LINEAR); 
    59      
     59 
    6060    setImage(image); 
    6161} 
     
    9191            else 
    9292            { 
    93                 return 1; // valid lhs._image is greater than null.  
     93                return 1; // valid lhs._image is greater than null. 
    9494            } 
    9595        } 
    96         else if (rhs._image.valid())  
    97         { 
    98             return -1; // valid rhs._image is greater than null.  
     96        else if (rhs._image.valid()) 
     97        { 
     98            return -1; // valid rhs._image is greater than null. 
    9999        } 
    100100    } 
     
    147147void TextureRectangle::apply(State& state) const 
    148148{ 
    149     static bool s_rectangleSupported =  
     149    static bool s_rectangleSupported = 
    150150            OSG_GL3_FEATURES || 
    151151            isGLExtensionSupported(state.getContextID(),"GL_ARB_texture_rectangle") || 
     
    159159    } 
    160160 
    161     // get the contextID (user defined ID of 0 upwards) for the  
     161    // get the contextID (user defined ID of 0 upwards) for the 
    162162    // current OpenGL context. 
    163163    const unsigned int contextID = state.getContextID(); 
     
    206206        { 
    207207            applyTexImage_subload(GL_TEXTURE_RECTANGLE, _image.get(), state, _textureWidth, _textureHeight, _internalFormat); 
    208   
     208 
    209209            // update the modified count to show that it is upto date. 
    210210            getModifiedCount(contextID) = _image->getModifiedCount(); 
     
    213213    else if (_subloadCallback.valid()) 
    214214    { 
    215         // we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object.         
     215        // we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object. 
    216216        _textureObjectBuffer[contextID] = textureObject = generateTextureObject(this, contextID,GL_TEXTURE_RECTANGLE); 
    217217 
     
    271271        _textureObjectBuffer[contextID] = textureObject = generateTextureObject( 
    272272                this, contextID,GL_TEXTURE_RECTANGLE,0,_internalFormat,_textureWidth,_textureHeight,1,0); 
    273          
     273 
    274274        textureObject->bind(); 
    275275 
     
    281281                     _sourceFormat ? _sourceFormat : _internalFormat, 
    282282                     _sourceType ? _sourceType : GL_UNSIGNED_BYTE, 
    283                      0);                 
    284                       
     283                     0); 
     284 
    285285        if (_readPBuffer.valid()) 
    286286        { 
    287287            _readPBuffer->bindPBufferToTexture(GL_FRONT); 
    288288        } 
    289          
     289 
    290290    } 
    291291    else 
     
    301301        return; 
    302302 
    303     // get the contextID (user defined ID of 0 upwards) for the  
     303    // get the contextID (user defined ID of 0 upwards) for the 
    304304    // current OpenGL context. 
    305305    const unsigned int contextID = state.getContextID(); 
     
    341341    if(isCompressedInternalFormat(_internalFormat) && extensions->isCompressedTexImage2DSupported()) 
    342342    { 
    343         extensions->glCompressedTexImage2D(target, 0, _internalFormat,  
     343        extensions->glCompressedTexImage2D(target, 0, _internalFormat, 
    344344          image->s(), image->t(), 0, 
    345           image->getImageSizeInBytes(),  
     345          image->getImageSizeInBytes(), 
    346346          dataPtr); 
    347347    } 
     
    354354          dataPtr ); 
    355355    } 
    356      
     356 
    357357 
    358358    if (pbo) 
     
    376376        return; 
    377377 
    378     if (image->s()!=inwidth || image->t()!=inheight || image->getInternalTextureFormat()!=inInternalFormat)  
     378    if (image->s()!=inwidth || image->t()!=inheight || image->getInternalTextureFormat()!=inInternalFormat) 
    379379    { 
    380380        applyTexImage_load(target, image, state, inwidth, inheight); 
     
    383383 
    384384 
    385     // get the contextID (user defined ID of 0 upwards) for the  
     385    // get the contextID (user defined ID of 0 upwards) for the 
    386386    // current OpenGL context. 
    387387    const unsigned int contextID = state.getContextID(); 
     
    396396 
    397397    glPixelStorei(GL_UNPACK_ALIGNMENT, image->getPacking()); 
    398     unsigned int rowLength = image->getRowLength();     
     398    unsigned int rowLength = image->getRowLength(); 
    399399 
    400400#ifdef DO_TIMING 
     
    420420    if(isCompressedInternalFormat(_internalFormat) && extensions->isCompressedTexSubImage2DSupported()) 
    421421    { 
    422         extensions->glCompressedTexSubImage2D(target, 0,  
    423           0,0,  
    424           image->s(), image->t(), 
    425           (GLenum)image->getPixelFormat(), 
    426           (GLenum)image->getDataType(), 
    427           dataPtr); 
    428     } 
    429     else 
    430     { 
    431         glTexSubImage2D(target, 0,  
     422        extensions->glCompressedTexSubImage2D(target, 0, 
    432423          0,0, 
    433424          image->s(), image->t(), 
     
    436427          dataPtr); 
    437428    } 
     429    else 
     430    { 
     431        glTexSubImage2D(target, 0, 
     432          0,0, 
     433          image->s(), image->t(), 
     434          (GLenum)image->getPixelFormat(), 
     435          (GLenum)image->getDataType(), 
     436          dataPtr); 
     437    } 
    438438 
    439439    if (pbo) 
     
    449449void TextureRectangle::computeInternalFormat() const 
    450450{ 
    451     if (_image.valid()) computeInternalFormatWithImage(*_image);  
     451    if (_image.valid()) computeInternalFormatWithImage(*_image); 
    452452    else computeInternalFormatType(); 
    453453} 
     
    456456{ 
    457457    const unsigned int contextID = state.getContextID(); 
    458      
     458 
    459459    if (_internalFormat==0) _internalFormat=GL_RGBA; 
    460460 
    461461    // get the globj for the current contextID. 
    462462    TextureObject* textureObject = getTextureObject(contextID); 
    463      
     463 
    464464    if (textureObject) 
    465465    { 
     
    474474        } 
    475475        // the relevent texture object is not of the right size so 
    476         // needs to been deleted     
    477         // remove previously bound textures.  
     476        // needs to been deleted 
     477        // remove previously bound textures. 
    478478        dirtyTextureObject(); 
    479479        // note, dirtyTextureObject() dirties all the texture objects for 
     
    482482        // RO July 2001. 
    483483    } 
    484      
    485      
     484 
     485 
    486486    // remove any previously assigned images as these are nolonger valid. 
    487487    _image = NULL; 
     
    492492 
    493493    textureObject->bind(); 
    494      
     494 
    495495    applyTexParameters(GL_TEXTURE_RECTANGLE,state); 
    496496 
     
    504504 
    505505        hardwareMipMapOn = _useHardwareMipMapGeneration && generateMipMapSupported; 
    506          
     506 
    507507        if (!hardwareMipMapOn) 
    508508        { 
     
    512512        } 
    513513    } 
    514 */     
     514*/ 
    515515//    if (hardwareMipMapOn) glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS,GL_TRUE); 
    516516 
     
    523523    _textureHeight = height; 
    524524//    _numMipmapLevels = 1; 
    525      
     525 
    526526    textureObject->setAllocated(1,_internalFormat,_textureWidth,_textureHeight,1,0); 
    527527 
     
    539539    // get the texture object for the current contextID. 
    540540    TextureObject* textureObject = getTextureObject(contextID); 
    541      
     541 
    542542    if (textureObject) 
    543543    { 
    544544        // we have a valid image 
    545545        textureObject->bind(); 
    546          
     546 
    547547        applyTexParameters(GL_TEXTURE_RECTANGLE,state); 
    548548