Simulant  21.12-349
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
skybox_manager.h
1 /* * Copyright (c) 2011-2017 Luke Benstead https://simulant-engine.appspot.com
2  *
3  * This file is part of Simulant.
4  *
5  * Simulant is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * Simulant is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with Simulant. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include <map>
22 
23 #include "../../generic/managed.h"
24 #include "../../generic/identifiable.h"
25 #include "../stage_node.h"
26 #include "../../types.h"
27 #include "../../managers/window_holder.h"
28 #include "../stage_node_manager.h"
29 #include "skybox.h"
30 #include "../../asset_manager.h"
31 #include "../stage_node_pool.h"
32 
33 namespace smlt {
34 
35 class Stage;
36 
37 typedef StageNodeManager<StageNodePool, SkyID, Skybox> TemplatedSkyboxManager;
38 
39 class SkyManager {
40  friend class Skybox;
41 
42 public:
43  SkyManager(Stage* stage, StageNodePool *pool);
44 
45  SkyManager(const SkyManager& rhs) = delete;
46  SkyManager& operator=(const SkyManager&) = delete;
47 
49  const Path& folder,
50  const TextureFlags& flags=TextureFlags()
51  );
52 
54  const Path& up,
55  const Path& down,
56  const Path& left,
57  const Path& right,
58  const Path& front,
59  const Path& back,
60  const TextureFlags &flags=TextureFlags()
61  );
62 
63  SkyboxPtr skybox(SkyID skybox_id);
64  bool destroy_skybox(SkyID skybox_id);
65 
66  Property<Stage* SkyManager::*> stage = { this, &SkyManager::stage_ };
67 
68  bool destroy_object(Skybox* skybox);
69  bool destroy_object_immediately(Skybox* skybox);
70 
71 private:
72  Stage* stage_ = nullptr;
73 
74  std::shared_ptr<TemplatedSkyboxManager> sky_manager_;
75 
76 };
77 
78 }
smlt::Property
Definition: property.h:202
smlt::TextureFlags
Definition: asset_manager.h:47
smlt::SkyManager::new_skybox_from_files
SkyboxPtr new_skybox_from_files(const Path &up, const Path &down, const Path &left, const Path &right, const Path &front, const Path &back, const TextureFlags &flags=TextureFlags())
new_skybox_from_absolute_files
Definition: skybox_manager.cpp:124
smlt::Stage
Definition: stage.h:92
smlt
Definition: animation.cpp:25
smlt::Polylist
Definition: polylist.h:67
smlt::UniqueID
Definition: unique_id.h:77
smlt::SkyManager::new_skybox_from_folder
SkyboxPtr new_skybox_from_folder(const Path &folder, const TextureFlags &flags=TextureFlags())
SkyboxManager::new_skybox_from_folder.
Definition: skybox_manager.cpp:47
smlt::Path
Definition: path.h:7
smlt::Skybox
Definition: skybox.h:39
smlt::SkyManager
Definition: skybox_manager.h:39
smlt::default_init_ptr
Definition: default_init_ptr.h:8