Debian Codegraph @

include/iscenegraphfactory.h

raw
1 #pragma once
2
3 #include "iscenegraph.h"
4
5 namespace scene
6 {
7
8 /**
9 * greebo: The scenegraph factory can be used to generate
10 * new instances of DarkRadiant's main scene manager.
11 *
12 * A Scenegraph consists of [0..N] scene::INodes, forming
13 * an acyclic graph. There is one main scenegraph in DarkRadiant
14 * accessible through GlobalSceneGraph(), but it's possible to have
15 * more than this one, used for preview scenes for example.
16 */
17 class ISceneGraphFactory :
18 public RegisterableModule
19 {
20 public:
21 /**
22 * Instantiates a new scenegraph.
23 */
24 virtual GraphPtr createSceneGraph() = 0;
25 };
26
27 } // namespace
28
29 const char* const MODULE_SCENEGRAPHFACTORY = "SceneGraphFactory";
30
31 // Global accessor to the rendersystem factory module
32 inline scene::ISceneGraphFactory& GlobalSceneGraphFactory()
33 {
34 static module::InstanceReference<scene::ISceneGraphFactory> _reference(MODULE_SCENEGRAPHFACTORY);
35 return _reference;
36 }