LCOV - code coverage report
Current view: top level - source/renderer - SkyManager.h (source / functions) Hit Total Coverage
Test: 0 A.D. test coverage report Lines: 0 6 0.0 %
Date: 2021-09-24 14:46:47 Functions: 0 2 0.0 %

          Line data    Source code
       1             : /* Copyright (C) 2021 Wildfire Games.
       2             :  * This file is part of 0 A.D.
       3             :  *
       4             :  * 0 A.D. is free software: you can redistribute it and/or modify
       5             :  * it under the terms of the GNU General Public License as published by
       6             :  * the Free Software Foundation, either version 2 of the License, or
       7             :  * (at your option) any later version.
       8             :  *
       9             :  * 0 A.D. is distributed in the hope that it will be useful,
      10             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             :  * GNU General Public License for more details.
      13             :  *
      14             :  * You should have received a copy of the GNU General Public License
      15             :  * along with 0 A.D.  If not, see <http://www.gnu.org/licenses/>.
      16             :  */
      17             : 
      18             : /*
      19             :  * Sky settings and texture management
      20             :  */
      21             : 
      22             : #ifndef INCLUDED_SKYMANAGER
      23             : #define INCLUDED_SKYMANAGER
      24             : 
      25             : #include "graphics/Texture.h"
      26             : 
      27             : #include <vector>
      28             : 
      29             : /**
      30             :  * Class SkyManager: Maintain sky settings and textures, and render the sky.
      31             :  */
      32             : class SkyManager
      33             : {
      34             : public:
      35             :     SkyManager();
      36             : 
      37             :     /**
      38             :      * Render the sky.
      39             :      */
      40             :     void RenderSky();
      41             : 
      42             :     /**
      43             :      * Return the currently selected sky set name.
      44             :      */
      45             :     inline const CStrW& GetSkySet() const
      46             :     {
      47           0 :         return m_SkySet;
      48             :     }
      49             : 
      50           0 :     GLuint GetSkyCube()
      51             :     {
      52           0 :         return m_SkyCubeMap;
      53             :     }
      54             : 
      55             :     /**
      56             :      * Set the sky set name, potentially loading the textures.
      57             :      */
      58             :     void SetSkySet(const CStrW& name);
      59             : 
      60             :     /**
      61             :      * Return a sorted list of available sky sets, in a form suitable
      62             :      * for passing to SetSkySet.
      63             :      */
      64             :     std::vector<CStrW> GetSkySets() const;
      65             : 
      66           0 :     bool GetRenderSky() const
      67             :     {
      68           0 :         return m_RenderSky;
      69             :     }
      70             : 
      71             :     void SetRenderSky(bool value)
      72             :     {
      73           0 :         m_RenderSky = value;
      74             :     }
      75             : 
      76             : private:
      77             :     void LoadSkyTextures();
      78             : 
      79             :     bool m_RenderSky;
      80             : 
      81             :     /// Name of current skyset (a directory within art/textures/skies)
      82             :     CStrW m_SkySet;
      83             : 
      84             :     // Indices into m_SkyTexture
      85             :     enum
      86             :     {
      87             :         FRONT,
      88             :         BACK,
      89             :         RIGHT,
      90             :         LEFT,
      91             :         TOP,
      92             :         NUMBER_OF_TEXTURES
      93             :     };
      94             : 
      95             :     // Sky textures
      96             :     CTexturePtr m_SkyTexture[NUMBER_OF_TEXTURES];
      97             : 
      98             :     GLuint m_SkyCubeMap;
      99             : };
     100             : 
     101             : 
     102             : #endif // INCLUDED_SKYMANAGER

Generated by: LCOV version 1.13