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
graphics
GameView.h
Go to the documentation of this file.
1
/* Copyright (C) 2010 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
#ifndef INCLUDED_GAMEVIEW
19
#define INCLUDED_GAMEVIEW
20
21
#include "
renderer/Scene.h
"
22
#include "
simulation2/system/Entity.h
"
23
24
#include "
lib/input.h
"
// InReaction - can't forward-declare enum
25
26
class
CGame
;
27
class
CObjectManager
;
28
class
CCamera
;
29
class
CCinemaManager
;
30
class
CVector3D
;
31
struct
SViewPort
;
32
33
struct
JSObject;
34
35
class
CGameViewImpl
;
36
37
class
CGameView
:
private
Scene
38
{
39
NONCOPYABLE
(
CGameView
);
40
private
:
41
CGameViewImpl
*
m
;
42
43
// Check whether lighting environment has changed and update vertex data if necessary
44
void
CheckLightEnv
();
45
46
public
:
47
//BEGIN: Implementation of Scene
48
virtual
void
EnumerateObjects
(
const
CFrustum
& frustum,
SceneCollector
* c);
49
virtual
CLOSTexture
&
GetLOSTexture
();
50
virtual
CTerritoryTexture
&
GetTerritoryTexture
();
51
//END: Implementation of Scene
52
53
private
:
54
// InitResources(): Load all graphics resources (textures, actor objects and
55
// alpha maps) required by the game
56
//void InitResources();
57
58
// UnloadResources(): Unload all graphics resources loaded by InitResources
59
void
UnloadResources
();
60
61
public
:
62
CGameView
(
CGame
*pGame);
63
~CGameView
();
64
65
void
SetViewport
(
const
SViewPort
& vp);
66
67
void
RegisterInit
();
68
int
Initialize
();
69
70
CObjectManager
&
GetObjectManager
()
const
;
71
72
/**
73
* Updates all the view information (i.e. rotate camera, scroll, whatever). This will *not* change any
74
* World information - only the *presentation*.
75
*
76
* @param deltaRealTime Elapsed real time since the last frame.
77
*/
78
void
Update
(
const
float
deltaRealTime);
79
80
void
BeginFrame
();
81
void
Render
();
82
83
InReaction
HandleEvent
(
const
SDL_Event_
* ev);
84
85
float
GetCameraX
();
86
float
GetCameraZ
();
87
void
MoveCameraTarget
(
const
CVector3D
& target);
88
void
ResetCameraTarget
(
const
CVector3D
& target);
89
void
ResetCameraAngleZoom
();
90
void
CameraFollow
(
entity_id_t
entity,
bool
firstPerson);
91
entity_id_t
GetFollowedEntity
();
92
93
CVector3D
GetSmoothPivot
(
CCamera
&camera)
const
;
94
95
float
GetNear
()
const
;
96
float
GetFar
()
const
;
97
float
GetFOV
()
const
;
98
float
GetCullFOV
()
const
;
99
100
#define DECLARE_BOOLEAN_SETTING(NAME) \
101
bool Get##NAME##Enabled(); \
102
void Set##NAME##Enabled(bool Enabled);
103
104
DECLARE_BOOLEAN_SETTING
(Culling);
105
DECLARE_BOOLEAN_SETTING
(LockCullCamera);
106
DECLARE_BOOLEAN_SETTING
(ConstrainCamera);
107
108
#undef DECLARE_BOOLEAN_SETTING
109
110
// Set projection of current camera using near, far, and FOV values
111
void
SetCameraProjection
();
112
113
CCamera
*
GetCamera
();
114
CCinemaManager
*
GetCinema
();
115
116
JSObject*
GetScript
();
117
};
118
extern
InReaction
game_view_handler
(
const
SDL_Event_
* ev);
119
#endif
CGameView::UnloadResources
void UnloadResources()
Definition:
GameView.cpp:602
CGame
The container that holds the rules, resources and attributes of the game.
Definition:
Game.h:39
CGameView::GetFar
float GetFar() const
Definition:
GameView.cpp:1046
CGameView::BeginFrame
void BeginFrame()
Definition:
GameView.cpp:473
Entity.h
CGameView::GetCinema
CCinemaManager * GetCinema()
Definition:
GameView.cpp:395
CGameView::GetSmoothPivot
CVector3D GetSmoothPivot(CCamera &camera) const
Definition:
GameView.cpp:667
input.h
CGameView::~CGameView
~CGameView()
Definition:
GameView.cpp:372
CGameView::EnumerateObjects
virtual void EnumerateObjects(const CFrustum &frustum, SceneCollector *c)
Send all objects that can be seen when rendering the given frustum to the scene collector.
Definition:
GameView.cpp:504
SViewPort
Definition:
Camera.h:31
CGameViewImpl
Definition:
GameView.cpp:151
CGameView::CameraFollow
void CameraFollow(entity_id_t entity, bool firstPerson)
Definition:
GameView.cpp:1030
CObjectManager
Definition:
ObjectManager.h:37
CVector3D
Definition:
Vector3D.h:28
CGameView::Render
void Render()
Definition:
GameView.cpp:496
CFrustum
Definition:
Frustum.h:38
Scene.h
CGameView::SetCameraProjection
void SetCameraProjection()
Definition:
GameView.cpp:1061
SDL_Event_
Definition:
libsdl.h:54
CGameView::GetCameraX
float GetCameraX()
Definition:
GameView.cpp:952
CGameView::m
CGameViewImpl * m
Definition:
GameView.h:41
CGameView::SetViewport
void SetViewport(const SViewPort &vp)
Definition:
GameView.cpp:379
CGameView::ResetCameraAngleZoom
void ResetCameraAngleZoom()
Definition:
GameView.cpp:1012
CGameView::GetScript
JSObject * GetScript()
SceneCollector
This interface accepts renderable objects.
Definition:
Scene.h:82
CGameView::GetFOV
float GetFOV() const
Definition:
GameView.cpp:1051
CGameView::Update
void Update(const float deltaRealTime)
Updates all the view information (i.e.
Definition:
GameView.cpp:672
CGameView::CheckLightEnv
void CheckLightEnv()
Definition:
GameView.cpp:579
InReaction
InReaction
Definition:
input.h:34
CGameView::Initialize
int Initialize()
Definition:
GameView.cpp:410
CCamera
Definition:
Camera.h:39
game_view_handler
InReaction game_view_handler(const SDL_Event_ *ev)
Definition:
GameView.cpp:1066
CGameView::CGameView
CGameView(CGame *pGame)
Definition:
GameView.cpp:354
CGameView
Definition:
GameView.h:37
CGameView::GetCamera
CCamera * GetCamera()
Definition:
GameView.cpp:390
CGameView::GetTerritoryTexture
virtual CTerritoryTexture & GetTerritoryTexture()
Return the territory texture to be used for rendering this scene.
Definition:
GameView.cpp:405
CGameView::GetCameraZ
float GetCameraZ()
Definition:
GameView.cpp:959
CGameView::GetFollowedEntity
entity_id_t GetFollowedEntity()
Definition:
GameView.cpp:1036
CGameView::RegisterInit
void RegisterInit()
Definition:
GameView.cpp:461
CGameView::GetNear
float GetNear() const
Definition:
GameView.cpp:1041
CCinemaManager
Definition:
CinemaTrack.h:125
CGameView::GetLOSTexture
virtual CLOSTexture & GetLOSTexture()
Return the LOS texture to be used for rendering this scene.
Definition:
GameView.cpp:400
CGameView::GetCullFOV
float GetCullFOV() const
Definition:
GameView.cpp:1056
CGameView::NONCOPYABLE
NONCOPYABLE(CGameView)
Scene
This interface describes a scene to the renderer.
Definition:
Scene.h:51
CGameView::DECLARE_BOOLEAN_SETTING
DECLARE_BOOLEAN_SETTING(Culling)
CGameView::GetObjectManager
CObjectManager & GetObjectManager() const
Definition:
GameView.cpp:385
CLOSTexture
Maintains the LOS (fog-of-war / shroud-of-darkness) texture, used for rendering and for the minimap...
Definition:
LOSTexture.h:32
CGameView::HandleEvent
InReaction HandleEvent(const SDL_Event_ *ev)
Definition:
GameView.cpp:1077
entity_id_t
u32 entity_id_t
Entity ID type.
Definition:
Entity.h:24
CGameView::MoveCameraTarget
void MoveCameraTarget(const CVector3D &target)
Definition:
GameView.cpp:966
CTerritoryTexture
Maintains the territory boundary texture, used for rendering and for the minimap. ...
Definition:
TerritoryTexture.h:29
CGameView::ResetCameraTarget
void ResetCameraTarget(const CVector3D &target)
Definition:
GameView.cpp:988
Generated on Mon Oct 14 2013 00:58:06 for Pyrogenesis by
1.8.5