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/osgViewer/PixelBufferCarbon.cpp

    r12292 r13041  
    77 * 
    88 */ 
    9   
     9 
    1010#if defined (__APPLE__) && (!__LP64__) 
    1111 
     
    2020 
    2121 
    22 /** creates a pixelformat from a Trait */         
     22/** creates a pixelformat from a Trait */ 
    2323AGLPixelFormat PixelBufferCarbon::createPixelFormat(osg::GraphicsContext::Traits* traits) { 
    2424 
    2525    std::vector<GLint> attributes; 
    26      
     26 
    2727    attributes.push_back(AGL_NO_RECOVERY); 
    2828    attributes.push_back(AGL_RGBA); 
    29     if (!traits->pbuffer)  
     29    if (!traits->pbuffer) 
    3030        attributes.push_back(AGL_COMPLIANT); 
    3131    else 
    3232        attributes.push_back(AGL_CLOSEST_POLICY); 
    33      
     33 
    3434    if (traits->doubleBuffer) attributes.push_back(AGL_DOUBLEBUFFER); 
    3535    if (traits->quadBufferStereo) attributes.push_back(AGL_STEREO); 
    36      
     36 
    3737    attributes.push_back(AGL_RED_SIZE); attributes.push_back(traits->red); 
    3838    attributes.push_back(AGL_GREEN_SIZE); attributes.push_back(traits->green); 
    3939    attributes.push_back(AGL_BLUE_SIZE); attributes.push_back(traits->blue); 
    4040    attributes.push_back(AGL_DEPTH_SIZE); attributes.push_back(traits->depth); 
    41      
     41 
    4242    if (traits->alpha) { attributes.push_back(AGL_ALPHA_SIZE); attributes.push_back(traits->alpha); } 
    43      
     43 
    4444    if (traits->stencil) { attributes.push_back(AGL_STENCIL_SIZE); attributes.push_back(traits->stencil); } 
    45      
    46     // TODO  
     45 
     46    // TODO 
    4747    // missing accumulation-buffer-stuff 
    4848 
     
    5454#endif 
    5555    attributes.push_back(AGL_NONE); 
    56      
     56 
    5757    return aglChoosePixelFormat(NULL, 0, &(attributes.front())); 
    5858} 
     
    7070 
    7171/** This is the class we need to create for pbuffers, note its not a GraphicsWindow as it won't need any of the event handling and window mapping facilities.*/ 
    72 /** Realise the GraphicsContext implementation,  
     72/** Realise the GraphicsContext implementation, 
    7373          * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ 
    74 bool PixelBufferCarbon::realizeImplementation()  
     74bool PixelBufferCarbon::realizeImplementation() 
    7575{ 
    7676    if (!_valid) { 
     
    7878        return false; 
    7979    } 
    80      
     80 
    8181    AGLContext sharedContext = NULL; 
    8282 
    83     // get any shared AGL contexts     
     83    // get any shared AGL contexts 
    8484    GraphicsHandleCarbon* graphicsHandleCarbon = dynamic_cast<GraphicsHandleCarbon*>(_traits->sharedContext); 
    85     if (graphicsHandleCarbon)  
     85    if (graphicsHandleCarbon) 
    8686    { 
    8787        sharedContext = graphicsHandleCarbon->getAGLContext(); 
    8888    } 
    89      
     89 
    9090    _context = aglCreateContext (_pixelformat, sharedContext); 
    91      
     91 
    9292    if (!_context) { 
    9393        OSG_WARN << "PixelBufferCarbon::realizeImplementation() aglCreateContext failed! " << aglErrorString(aglGetError()) << std::endl; 
    9494        return false; 
    9595    } 
    96      
    9796 
    98      
     97 
     98 
    9999    _realized = aglCreatePBuffer (_traits->width, _traits->height, _traits->target, GL_RGBA, _traits->level, &(_pbuffer)); 
    100100    if (!_realized) { 
    101101        OSG_WARN << "PixelBufferCarbon::realizeImplementation() aglCreatePBuffer failed! " << aglErrorString(aglGetError()) << std::endl; 
    102102    } 
    103      
     103 
    104104    makeCurrentImplementation(); 
    105      
     105 
    106106    _realized = aglSetPBuffer(_context, _pbuffer, _traits->face, _traits->level, 0); 
    107107    if (!_realized) { 
     
    111111} 
    112112 
    113 void  PixelBufferCarbon::closeImplementation()   
    114 {  
     113void  PixelBufferCarbon::closeImplementation() 
     114{ 
    115115    if (_pbuffer) aglDestroyPBuffer(_pbuffer); 
    116116    if (_context) aglDestroyContext(_context); 
    117117    if (_pixelformat) aglDestroyPixelFormat(_pixelformat); 
    118      
     118 
    119119    _pbuffer = NULL; 
    120120    _context = NULL; 
    121121    _pixelformat = NULL; 
    122      
     122 
    123123    _valid = _realized = false; 
    124124} 
     
    126126/** Make this graphics context current implementation. 
    127127  * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ 
    128 bool  PixelBufferCarbon::makeCurrentImplementation()  
    129 {  
     128bool  PixelBufferCarbon::makeCurrentImplementation() 
     129{ 
    130130    return (_realized) ? (aglSetCurrentContext(_context) == GL_TRUE) : false; 
    131131} 
    132          
     132 
    133133/** Make this graphics context current with specified read context implementation. 
    134134  * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ 
    135 bool  PixelBufferCarbon::makeContextCurrentImplementation(GraphicsContext* /*readContext*/)  {  
     135bool  PixelBufferCarbon::makeContextCurrentImplementation(GraphicsContext* /*readContext*/)  { 
    136136    return makeCurrentImplementation(); 
    137137} 
    138138 
    139139/** Release the graphics context.*/ 
    140 bool PixelBufferCarbon::releaseContextImplementation()  
    141 {   
     140bool PixelBufferCarbon::releaseContextImplementation() 
     141{ 
    142142     return (aglSetCurrentContext(NULL) == GL_TRUE); 
    143143} 
     
    146146/** Pure virtual, Bind the graphics context to associated texture implementation. 
    147147  * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ 
    148 void PixelBufferCarbon::bindPBufferToTextureImplementation( GLenum buffer ){  
     148void PixelBufferCarbon::bindPBufferToTextureImplementation( GLenum buffer ){ 
    149149 
    150     OSG_NOTICE<<"GraphicsWindow::void bindPBufferToTextureImplementation(..) not implemented."<<std::endl;  
     150    OSG_NOTICE<<"GraphicsWindow::void bindPBufferToTextureImplementation(..) not implemented."<<std::endl; 
    151151} 
    152152 
    153153/** Swap the front and back buffers implementation. 
    154154  * Pure virtual - must be implemented by Concrate implementations of GraphicsContext. */ 
    155 void PixelBufferCarbon::swapBuffersImplementation()   
    156 {  
     155void PixelBufferCarbon::swapBuffersImplementation() 
     156{ 
    157157     aglSwapBuffers(_context); 
    158158} 
    159     
    160          
    161 PixelBufferCarbon::~PixelBufferCarbon()  
     159 
     160 
     161PixelBufferCarbon::~PixelBufferCarbon() 
    162162{ 
    163163    close(true);