1 /* Copyright (C) 2021 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/>.
21 * Description : This file contains the interfaces that are used to send a
22 * : scene to the renderer, and for the renderer to query objects
25 * @note This file would fit just as well into the graphics/ subdirectory.
28 #ifndef INCLUDED_SCENE
29 #define INCLUDED_SCENE
35 class CParticleEmitter
;
38 class CMiniMapTexture
;
39 class CTerritoryTexture
;
41 struct SOverlayTexturedLine
;
42 struct SOverlaySprite
;
44 struct SOverlaySphere
;
49 * This interface describes a scene to the renderer.
51 * @see CRenderer::RenderScene
59 * Send all objects that can be seen when rendering the given frustum
60 * to the scene collector.
61 * @param frustum The frustum that will be used for rendering.
62 * @param c The scene collector that should receive objects inside the frustum
65 virtual void EnumerateObjects(const CFrustum
& frustum
, SceneCollector
* c
) = 0;
68 * Return the LOS texture to be used for rendering this scene.
70 virtual CLOSTexture
& GetLOSTexture() = 0;
73 * Return the territory texture to be used for rendering this scene.
75 virtual CTerritoryTexture
& GetTerritoryTexture() = 0;
78 * Return the minimap texture to be used for rendering this scene.
80 virtual CMiniMapTexture
& GetMiniMapTexture() = 0;
85 * This interface accepts renderable objects.
87 * @see Scene::EnumerateObjects
92 virtual ~SceneCollector() {}
95 * Submit a terrain patch that is part of the scene.
97 virtual void Submit(CPatch
* patch
) = 0;
100 * Submit a line-based overlay.
102 virtual void Submit(SOverlayLine
* overlay
) = 0;
105 * Submit a textured line overlay.
107 virtual void Submit(SOverlayTexturedLine
* overlay
) = 0;
110 * Submit a sprite overlay.
112 virtual void Submit(SOverlaySprite
* overlay
) = 0;
115 * Submit a textured quad overlay.
117 virtual void Submit(SOverlayQuad
* overlay
) = 0;
120 * Submit a sphere overlay.
122 virtual void Submit(SOverlaySphere
* overlay
) = 0;
125 * Submit a terrain decal.
127 virtual void Submit(CModelDecal
* decal
) = 0;
130 * Submit a particle emitter.
132 virtual void Submit(CParticleEmitter
* emitter
) = 0;
135 * Submit a model that is part of the scene,
136 * without submitting attached models.
138 virtual void SubmitNonRecursive(CModel
* model
) = 0;
141 * Submit a model that is part of the scene,
142 * including attached sub-models.
144 * @note This function is implemented using SubmitNonRecursive,
145 * so you shouldn't have to reimplement it.
147 virtual void SubmitRecursive(CModelAbstract
* model
);
151 #endif // INCLUDED_SCENE