LCOV - code coverage report
Current view: top level - eq/client - windowSettings.cpp (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 25 36 69.4 %
Date: 2014-06-18 Functions: 11 14 78.6 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2014, Daniel Nachbaur <danielnachbaur@gmail.com>
       3             :  *
       4             :  * This library is free software; you can redistribute it and/or modify it under
       5             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       6             :  * by the Free Software Foundation.
       7             :  *
       8             :  * This library is distributed in the hope that it will be useful, but WITHOUT
       9             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      10             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      11             :  * details.
      12             :  *
      13             :  * You should have received a copy of the GNU Lesser General Public License
      14             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      15             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      16             :  */
      17             : 
      18             : #include "windowSettings.h"
      19             : 
      20             : #include "gl.h"
      21             : 
      22             : namespace eq
      23             : {
      24             : namespace detail
      25             : {
      26             : class WindowSettings
      27             : {
      28             : public:
      29         570 :     WindowSettings()
      30         570 :         : sharedContextWindow( 0 )
      31             :     {
      32         570 :     }
      33          64 :     ~WindowSettings() {}
      34             : 
      35          34 :     WindowSettings( const WindowSettings& rhs )
      36          34 :         : sharedContextWindow( rhs.sharedContextWindow )
      37             :     {
      38          34 :     }
      39             : 
      40           0 :     WindowSettings& operator=( const WindowSettings& rhs )
      41             :     {
      42           0 :         if( this == &rhs )
      43           0 :             return *this;
      44             : 
      45           0 :         sharedContextWindow = rhs.sharedContextWindow;
      46           0 :         return *this;
      47             :     }
      48             : 
      49             :     const SystemWindow* sharedContextWindow;
      50             : };
      51             : }
      52             : 
      53         570 : WindowSettings::WindowSettings()
      54             :     : fabric::WindowSettings()
      55         570 :     , _impl( new detail::WindowSettings( ))
      56             : {
      57         570 : }
      58             : 
      59          34 : WindowSettings::WindowSettings( const WindowSettings& rhs )
      60             :     : fabric::WindowSettings( rhs )
      61          34 :     , _impl( new detail::WindowSettings( *rhs._impl ))
      62             : {
      63          34 : }
      64             : 
      65         128 : WindowSettings::~WindowSettings()
      66             : {
      67          64 :     delete _impl;
      68          64 : }
      69             : 
      70           0 : WindowSettings& WindowSettings::operator=( const WindowSettings& rhs )
      71             : {
      72           0 :     fabric::WindowSettings::operator =( rhs );
      73           0 :     *_impl = *rhs._impl;
      74           0 :     return *this;
      75             : }
      76             : 
      77          17 : void WindowSettings::setSharedContextWindow( const SystemWindow* window )
      78             : {
      79          17 :     _impl->sharedContextWindow = window;
      80          17 : }
      81             : 
      82          17 : const SystemWindow* WindowSettings::getSharedContextWindow() const
      83             : {
      84          17 :     return _impl->sharedContextWindow;
      85             : }
      86             : 
      87          13 : uint32_t WindowSettings::getColorFormat() const
      88             : {
      89          13 :     switch( getIAttribute( IATTR_PLANES_COLOR ))
      90             :     {
      91           0 :         case RGBA32F:  return GL_RGBA32F;
      92           0 :         case RGBA16F:  return GL_RGBA16F;
      93          13 :         default:       return GL_RGBA;
      94             :     }
      95             : }
      96             : 
      97          36 : }

Generated by: LCOV version 1.10