From 3a5509b2f95beeb3a8708340ee7469fd2088b83f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 9 Apr 2009 15:33:28 +0000 Subject: [PATCH] Converted tabs to four spaces --- src/osgViewer/PixelBufferCarbon.cpp | 82 ++++++++++++++--------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/osgViewer/PixelBufferCarbon.cpp b/src/osgViewer/PixelBufferCarbon.cpp index cf3f0d285..1bed7b526 100644 --- a/src/osgViewer/PixelBufferCarbon.cpp +++ b/src/osgViewer/PixelBufferCarbon.cpp @@ -27,9 +27,9 @@ AGLPixelFormat PixelBufferCarbon::createPixelFormat(osg::GraphicsContext::Traits attributes.push_back(AGL_NO_RECOVERY); attributes.push_back(AGL_RGBA); if (!traits->pbuffer) - attributes.push_back(AGL_COMPLIANT); - else - attributes.push_back(AGL_CLOSEST_POLICY); + attributes.push_back(AGL_COMPLIANT); + else + attributes.push_back(AGL_CLOSEST_POLICY); if (traits->doubleBuffer) attributes.push_back(AGL_DOUBLEBUFFER); if (traits->quadBufferStereo) attributes.push_back(AGL_STEREO); @@ -73,12 +73,12 @@ void PixelBufferCarbon::init() * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ bool PixelBufferCarbon::realizeImplementation() { - if (!_valid) { - osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglChoosePixelFormat failed! " << aglErrorString(aglGetError()) << std::endl; - return false; - } - - AGLContext sharedContext = NULL; + if (!_valid) { + osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglChoosePixelFormat failed! " << aglErrorString(aglGetError()) << std::endl; + return false; + } + + AGLContext sharedContext = NULL; // get any shared GLX contexts GraphicsWindowCarbon* graphicsWindowCarbon = dynamic_cast(_traits->sharedContext); @@ -94,55 +94,55 @@ bool PixelBufferCarbon::realizeImplementation() sharedContext = pixelBufferCarbon->getAGLContext(); } } - - _context = aglCreateContext (_pixelformat, sharedContext); - - if (!_context) { - osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglCreateContext failed! " << aglErrorString(aglGetError()) << std::endl; - return false; - } - + + _context = aglCreateContext (_pixelformat, sharedContext); + + if (!_context) { + osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglCreateContext failed! " << aglErrorString(aglGetError()) << std::endl; + return false; + } + - - _realized = aglCreatePBuffer (_traits->width, _traits->height, _traits->target, GL_RGBA, _traits->level, &(_pbuffer)); - if (!_realized) { - osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglCreatePBuffer failed! " << aglErrorString(aglGetError()) << std::endl; - } - - makeCurrentImplementation(); - - _realized = aglSetPBuffer(_context, _pbuffer, _traits->face, _traits->level, 0); - if (!_realized) { - osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglSetPBuffer failed! " << aglErrorString(aglGetError()) << std::endl; - } - return _realized; + + _realized = aglCreatePBuffer (_traits->width, _traits->height, _traits->target, GL_RGBA, _traits->level, &(_pbuffer)); + if (!_realized) { + osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglCreatePBuffer failed! " << aglErrorString(aglGetError()) << std::endl; + } + + makeCurrentImplementation(); + + _realized = aglSetPBuffer(_context, _pbuffer, _traits->face, _traits->level, 0); + if (!_realized) { + osg::notify(osg::WARN) << "PixelBufferCarbon::realizeImplementation() aglSetPBuffer failed! " << aglErrorString(aglGetError()) << std::endl; + } + return _realized; } void PixelBufferCarbon::closeImplementation() { - if (_pbuffer) aglDestroyPBuffer(_pbuffer); - if (_context) aglDestroyContext(_context); - if (_pixelformat) aglDestroyPixelFormat(_pixelformat); - _valid = _realized = false; + if (_pbuffer) aglDestroyPBuffer(_pbuffer); + if (_context) aglDestroyContext(_context); + if (_pixelformat) aglDestroyPixelFormat(_pixelformat); + _valid = _realized = false; } /** Make this graphics context current implementation. * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ bool PixelBufferCarbon::makeCurrentImplementation() { - return (_realized) ? (aglSetCurrentContext(_context) == GL_TRUE) : false; + return (_realized) ? (aglSetCurrentContext(_context) == GL_TRUE) : false; } /** Make this graphics context current with specified read context implementation. * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ bool PixelBufferCarbon::makeContextCurrentImplementation(GraphicsContext* /*readContext*/) { - return makeCurrentImplementation(); + return makeCurrentImplementation(); } /** Release the graphics context.*/ bool PixelBufferCarbon::releaseContextImplementation() { - return (aglSetCurrentContext(NULL) == GL_TRUE); + return (aglSetCurrentContext(NULL) == GL_TRUE); } @@ -150,20 +150,20 @@ bool PixelBufferCarbon::releaseContextImplementation() * Pure virtual - must be implemented by concrate implementations of GraphicsContext. */ void PixelBufferCarbon::bindPBufferToTextureImplementation( GLenum buffer ){ - osg::notify(osg::NOTICE)<<"GraphicsWindow::void bindPBufferToTextureImplementation(..) not implemented."<