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

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

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

    r13038 r13041  
    3030{ 
    3131    public: 
    32      
     32 
    3333        struct OSG_EXPORT ScreenIdentifier 
    3434        { 
     
    3838 
    3939            ScreenIdentifier(const std::string& in_hostName,int in_displayNum, int in_screenNum); 
    40              
    41             /** Return the display name in the form hostName::displayNum:screenNum. */     
     40 
     41            /** Return the display name in the form hostName::displayNum:screenNum. */ 
    4242            std::string displayName() const; 
    43              
     43 
    4444            /** Read the DISPLAY environmental variable, and set the ScreenIdentifier accordingly. 
    4545              * Note, if either of displayNum or screenNum are not defined then -1 is set respectively to 
     
    4747              * call setUndefinedScreenDetailsToDefaultScreen() after readDISPLAY() to ensure valid values. */ 
    4848            void readDISPLAY(); 
    49              
     49 
    5050            /** Set the screenIndentifier from the displayName string. 
    5151              * Note, if either of displayNum or screenNum are not defined then -1 is set to 
     
    6565            int screenNum; 
    6666        }; 
    67      
     67 
    6868        /** GraphicsContext Traits object provides the specification of what type of graphics context is required.*/ 
    6969        struct OSG_EXPORT Traits : public osg::Referenced, public ScreenIdentifier 
    7070        { 
    7171            Traits(DisplaySettings* ds=0); 
    72                              
     72 
    7373            // graphics context original and size 
    7474            int x; 
     
    7676            int width; 
    7777            int height; 
    78              
     78 
    7979            // window decoration and behaviour 
    8080            std::string windowName; 
    8181            bool        windowDecoration; 
    8282            bool        supportsResize; 
    83              
     83 
    8484            // buffer depths, 0 equals off. 
    8585            unsigned int red; 
     
    105105            unsigned int    face; 
    106106            unsigned int    mipMapGeneration; 
    107              
     107 
    108108            // V-sync 
    109109            bool            vsync; 
    110              
     110 
    111111            // Swap Group 
    112112            bool            swapGroupEnabled; 
     
    116116            // use multithreaded OpenGL-engine (OS X only) 
    117117            bool            useMultiThreadedOpenGLEngine; 
    118              
     118 
    119119            // enable cursor 
    120120            bool            useCursor; 
     
    127127            /** return true if glContextVersion is set in the form major.minor, and assign the appropriate major and minor values to the associated parameters.*/ 
    128128            bool getContextVersion(unsigned int& major, unsigned int& minor) const; 
    129              
     129 
    130130            // shared context 
    131131            GraphicsContext* sharedContext; 
    132              
     132 
    133133            osg::ref_ptr<osg::Referenced> inheritedWindowData; 
    134              
     134 
    135135            // ask the GraphicsWindow implementation to set the pixel format of an inherited window 
    136136            bool setInheritedWindowPixelFormat; 
    137              
     137 
    138138            // X11 hint whether to override the window managers window size/position redirection 
    139139            bool overrideRedirect; 
     
    178178 
    179179            virtual GraphicsContext* createGraphicsContext(Traits* traits) = 0; 
    180              
     180 
    181181            virtual ~WindowingSystemInterface() {} 
    182182 
     
    208208            } 
    209209        }; 
    210      
    211      
     210 
     211 
    212212        /** Set the query the windowing system for screens and create graphics context - this functor should be supplied by the windows toolkit. */ 
    213213        static void setWindowingSystemInterface(WindowingSystemInterface* wsInterface); 
    214          
     214 
    215215        /** Get the WindowingSystemInterface*/ 
    216216        static WindowingSystemInterface* getWindowingSystemInterface(); 
    217      
     217 
    218218        /** Create a graphics context for a specified set of traits.*/ 
    219219        static GraphicsContext* createGraphicsContext(Traits* traits); 
    220          
     220 
    221221        /** Create a contextID for a new graphics context, this contextID is used to set up the osg::State associate with context. 
    222222          * Automatically increments the usage count of the contextID to 1.*/ 
     
    231231        /** Decrement the usage count associate with a contextID. Once the contextID goes to 0 the contextID is then free to be reused.*/ 
    232232        static void decrementContextIDUsageCount(unsigned int contextID); 
    233      
     233 
    234234        typedef std::vector<GraphicsContext*> GraphicsContexts; 
    235          
     235 
    236236        /** Get all the registered graphics contexts.*/ 
    237237        static GraphicsContexts getAllRegisteredGraphicsContexts(); 
    238          
     238 
    239239        /** Get all the registered graphics contexts associated with a specific contextID.*/ 
    240240        static GraphicsContexts getRegisteredGraphicsContexts(unsigned int contextID); 
    241          
     241 
    242242        /** Get the GraphicsContext for doing background compilation for GraphicsContexts associated with specified contextID.*/ 
    243243        static void setCompileContext(unsigned int contextID, GraphicsContext* gc); 
     
    245245        /** Get existing or create a new GraphicsContext to do background compilation for GraphicsContexts associated with specified contextID.*/ 
    246246        static  GraphicsContext* getOrCreateCompileContext(unsigned int contextID); 
    247          
     247 
    248248        /** Get the GraphicsContext for doing background compilation for GraphicsContexts associated with specified contextID.*/ 
    249249        static GraphicsContext* getCompileContext(unsigned int contextID); 
    250250 
    251251    public: 
    252      
     252 
    253253        /** Add operation to end of OperationQueue.*/ 
    254254        void add(Operation* operation); 
    255          
     255 
    256256        /** Remove operation from OperationQueue.*/ 
    257257        void remove(Operation* operation); 
     
    267267 
    268268        typedef std::list< ref_ptr<Operation> > GraphicsOperationQueue; 
    269          
     269 
    270270        /** Get the operations queue, not you must use the OperationsMutex when accessing the queue.*/ 
    271271        GraphicsOperationQueue& getOperationsQueue() { return _operations; } 
     
    282282 
    283283    public: 
    284      
     284 
    285285        /** Get the traits of the GraphicsContext.*/ 
    286286        inline const Traits* getTraits() const { return _traits.get(); } 
     
    292292        /** Set the State object which tracks the current OpenGL state for this graphics context.*/ 
    293293        inline void setState(State* state) { _state = state; } 
    294          
     294 
    295295        /** Get the State object which tracks the current OpenGL state for this graphics context.*/ 
    296296        inline State* getState() { return _state.get(); } 
    297          
     297 
    298298        /** Get the const State object which tracks the current OpenGL state for this graphics context.*/ 
    299299        inline const State* getState() const { return _state.get(); } 
     
    305305        /** Returns the clear color. */ 
    306306        inline const Vec4& getClearColor() const { return _clearColor; } 
    307          
     307 
    308308        /** Set the clear mask used in glClear(..). 
    309309          * Defaults to 0 - so no clear is done by default by the GraphicsContext, instead the Cameras attached to the GraphicsContext will do the clear. 
     
    313313        /** Get the clear mask.*/ 
    314314        inline GLbitfield getClearMask() const { return _clearMask; } 
    315          
     315 
    316316        /** Do an OpenGL clear of the full graphics context/window. 
    317317          * Note, must only be called from a thread with this context current.*/ 
    318318        virtual void clear(); 
    319          
     319 
    320320        double getTimeSinceLastClear() const { return osg::Timer::instance()->delta_s(_lastClearTick, osg::Timer::instance()->tick()); } 
    321          
     321 
    322322 
    323323        /** Realize the GraphicsContext.*/ 
     
    339339 
    340340        /** Make this graphics context current. 
    341           * Implemented by calling makeCurrentImplementation().  
     341          * Implemented by calling makeCurrentImplementation(). 
    342342          * Returns true on success. */ 
    343343        bool makeCurrent(); 
    344          
     344 
    345345        /** Make this graphics context current with specified read context. 
    346346          * Implemented by calling makeContextCurrentImplementation(). 
    347347          * Returns true on success. */ 
    348348        bool makeContextCurrent(GraphicsContext* readContext); 
    349          
     349 
    350350        /** Release the graphics context. 
    351351          * Returns true on success. */ 
    352352        bool releaseContext(); 
    353          
     353 
    354354        /** Return true if the current thread has this OpenGL graphics context.*/ 
    355355        inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThread(); } 
     
    373373 
    374374 
    375         /** Realize the GraphicsContext implementation,  
     375        /** Realize the GraphicsContext implementation, 
    376376          * Pure virtual - must be implemented by concrete implementations of GraphicsContext. */ 
    377377        virtual bool realizeImplementation() = 0; 
     
    388388          * Pure virtual - must be implemented by concrete implementations of GraphicsContext. */ 
    389389        virtual bool makeCurrentImplementation() = 0; 
    390          
     390 
    391391        /** Make this graphics context current with specified read context implementation. 
    392392          * Pure virtual - must be implemented by concrete implementations of GraphicsContext. */ 
     
    408408          * developers to provide custom behavior for swap. 
    409409          * The callback must call 
    410           * GraphicsContext::swapBuffersImplementation() */   
     410          * GraphicsContext::swapBuffersImplementation() */ 
    411411        void setSwapCallback(SwapCallback* rc) { _swapCallback = rc; } 
    412412 
     
    468468        /** Get the the const list of cameras associated with this graphics context.*/ 
    469469        const Cameras& getCameras() const { return _cameras; } 
    470          
     470 
    471471        /** set the default FBO-id, this id will be used when the rendering-backend is finished with RTT FBOs */ 
    472472        void setDefaultFboId(GLuint i) { _defaultFboId = i; } 
    473          
     473 
    474474        GLuint getDefaultFboId() const { return _defaultFboId; } 
    475475 
     
    481481 
    482482    protected: 
    483          
     483 
    484484        GraphicsContext(); 
    485485        GraphicsContext(const GraphicsContext&, const osg::CopyOp&); 
     
    499499        void addCamera(osg::Camera* camera); 
    500500        void removeCamera(osg::Camera* camera); 
    501          
     501 
    502502        Cameras _cameras; 
    503503 
    504504        friend class osg::Camera; 
    505505 
    506         ref_ptr<Traits>         _traits;         
     506        ref_ptr<Traits>         _traits; 
    507507        ref_ptr<State>          _state; 
    508508 
     
    511511 
    512512        OpenThreads::Thread*    _threadOfLastMakeCurrent; 
    513          
     513 
    514514        OpenThreads::Mutex                  _operationsMutex; 
    515515        osg::ref_ptr<osg::RefBlock>         _operationsBlock; 
     
    518518 
    519519        ref_ptr<GraphicsThread>             _graphicsThread; 
    520          
     520 
    521521        ref_ptr<ResizedCallback>            _resizedCallback; 
    522522        ref_ptr<SwapCallback>               _swapCallback; 
    523          
     523 
    524524        Timer_t                             _lastClearTick; 
    525          
     525 
    526526        GLuint                              _defaultFboId; 
    527527};