Merge 'remotes/trunk'
[0ad.git] / source / renderer / SkyManager.h
blobdb38867481b67dea1a849f40ba2150b882017b86
1 /* Copyright (C) 2012 Wildfire Games.
2 * This file is part of 0 A.D.
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.
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.
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/>.
19 * Sky settings and texture management
22 #ifndef INCLUDED_SKYMANAGER
23 #define INCLUDED_SKYMANAGER
25 #include "graphics/Texture.h"
27 /**
28 * Class SkyManager: Maintain sky settings and textures, and render the sky.
30 class SkyManager
32 public:
33 bool m_RenderSky;
34 float m_HorizonHeight;
36 public:
37 SkyManager();
39 /**
40 * RenderSky: Render the sky.
42 void RenderSky();
44 /**
45 * GetSkySet(): Return the currently selected sky set name.
47 inline const CStrW& GetSkySet() const {
48 return m_SkySet;
51 GLuint GetSkyCube() {
52 return m_SkyCubeMap;
55 /**
56 * GetSkySet(): Set the sky set name, potentially loading the textures.
58 void SetSkySet(const CStrW& name);
60 /**
61 * Return a sorted list of available sky sets, in a form suitable
62 * for passing to SetSkySet.
64 std::vector<CStrW> GetSkySets() const;
66 private:
67 void LoadSkyTextures();
69 /// Name of current skyset (a directory within art/textures/skies)
70 CStrW m_SkySet;
72 // Indices into m_SkyTexture
73 enum
75 FRONT,
76 BACK,
77 RIGHT,
78 LEFT,
79 TOP,
80 numTextures
83 // Sky textures
84 CTexturePtr m_SkyTexture[numTextures];
86 GLuint m_SkyCubeMap;
88 // Array of image names (defined in SkyManager.cpp), in the order of the IMG_ id's
89 static const wchar_t* s_imageNames[numTextures];
93 #endif // INCLUDED_SKYMANAGER