Pyrogenesis
13997
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
renderer
SkyManager.h
Go to the documentation of this file.
1
/* Copyright (C) 2012 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
/**
28
* Class SkyManager: Maintain sky settings and textures, and render the sky.
29
*/
30
class
SkyManager
31
{
32
public
:
33
bool
m_RenderSky
;
34
float
m_HorizonHeight
;
35
36
public
:
37
SkyManager
();
38
39
/**
40
* RenderSky: Render the sky.
41
*/
42
void
RenderSky
();
43
44
/**
45
* GetSkySet(): Return the currently selected sky set name.
46
*/
47
inline
const
CStrW&
GetSkySet
()
const
{
48
return
m_SkySet
;
49
}
50
51
GLuint
GetSkyCube
() {
52
return
m_SkyCubeMap
;
53
}
54
55
/**
56
* GetSkySet(): 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
private
:
67
void
LoadSkyTextures
();
68
69
/// Name of current skyset (a directory within art/textures/skies)
70
CStrW
m_SkySet
;
71
72
// Indices into m_SkyTexture
73
enum
74
{
75
FRONT
,
76
BACK
,
77
RIGHT
,
78
LEFT
,
79
TOP
,
80
numTextures
81
};
82
83
// Sky textures
84
CTexturePtr
m_SkyTexture
[
numTextures
];
85
86
GLuint
m_SkyCubeMap
;
87
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
];
90
};
91
92
93
#endif // INCLUDED_SKYMANAGER
SkyManager::RenderSky
void RenderSky()
RenderSky: Render the sky.
Definition:
SkyManager.cpp:220
SkyManager::LEFT
Definition:
SkyManager.h:78
Texture.h
SkyManager::m_SkyCubeMap
GLuint m_SkyCubeMap
Definition:
SkyManager.h:86
SkyManager::RIGHT
Definition:
SkyManager.h:77
SkyManager::GetSkySets
std::vector< CStrW > GetSkySets() const
Return a sorted list of available sky sets, in a form suitable for passing to SetSkySet.
Definition:
SkyManager.cpp:197
SkyManager::m_HorizonHeight
float m_HorizonHeight
Definition:
SkyManager.h:34
SkyManager::m_SkyTexture
CTexturePtr m_SkyTexture[numTextures]
Definition:
SkyManager.h:84
SkyManager::m_SkySet
CStrW m_SkySet
Name of current skyset (a directory within art/textures/skies)
Definition:
SkyManager.h:70
SkyManager::LoadSkyTextures
void LoadSkyTextures()
Definition:
SkyManager.cpp:77
SkyManager::GetSkyCube
GLuint GetSkyCube()
Definition:
SkyManager.h:51
SkyManager::SkyManager
SkyManager()
Definition:
SkyManager.cpp:63
SkyManager::m_RenderSky
bool m_RenderSky
Definition:
SkyManager.h:33
SkyManager::s_imageNames
static const wchar_t * s_imageNames[numTextures]
Definition:
SkyManager.h:89
SkyManager::GetSkySet
const CStrW & GetSkySet() const
GetSkySet(): Return the currently selected sky set name.
Definition:
SkyManager.h:47
SkyManager::BACK
Definition:
SkyManager.h:76
SkyManager::SetSkySet
void SetSkySet(const CStrW &name)
GetSkySet(): Set the sky set name, potentially loading the textures.
Definition:
SkyManager.cpp:179
SkyManager::TOP
Definition:
SkyManager.h:79
SkyManager::FRONT
Definition:
SkyManager.h:75
SkyManager::numTextures
Definition:
SkyManager.h:80
CTexturePtr
shared_ptr< CTexture > CTexturePtr
Definition:
Texture.h:22
SkyManager
Class SkyManager: Maintain sky settings and textures, and render the sky.
Definition:
SkyManager.h:30
Generated on Mon Oct 14 2013 00:58:08 for Pyrogenesis by
1.8.5