2 #include <Engine/RaEngine.hpp>
4 #include <Core/Tasks/TaskQueue.hpp>
6 #include <Core/Utils/Singleton.hpp>
8 #include <glbinding/Version.h>
9 #include <globjects/State.h>
21 class FileLoaderInterface;
36 class ShaderProgramManager;
42 class RenderObjectManager;
75 glbinding::Version getOpenGLVersion()
const;
100 bool registerSystem(
const std::string& name,
Scene::System* system,
int priority = 1 );
119 const std::string& componentName,
120 const std::string& roName = std::string() )
const;
131 bool loadFile(
const std::string& file );
140 const Core::Asset::FileData& getFileData()
const;
160 Rendering::RenderObjectManager* getRenderObjectManager()
const;
166 Scene::EntityManager* getEntityManager()
const;
193 void registerFileLoader( std::shared_ptr<Core::Asset::FileLoaderInterface> fileLoader );
199 const std::vector<std::shared_ptr<Core::Asset::FileLoaderInterface>>& getFileLoaders()
const;
204 Core::Aabb computeSceneAabb()
const;
210 void pushFboAndViewport();
217 void popFboAndViewport();
229 void setRealTime(
bool realTime );
235 bool isRealTime()
const;
241 bool isConstantTime()
const;
251 bool setConstantTimeStep( Scalar dt,
bool forceConstantTime =
false );
263 void setForwardBackward(
bool mode );
268 void play(
bool isPlaying );
286 void setTime( Scalar t );
294 void setStartTime( Scalar t );
299 Scalar getStartTime()
const;
308 void setEndTime( Scalar t );
313 Scalar getEndTime()
const;
318 Scalar getTime()
const;
323 uint getFrame()
const;
326 std::string getResourcesDir() {
return m_resourcesRootDir; }
349 glbinding::Version m_glVersion {};
353 void registerDefaultPrograms();
355 using Priority = int;
356 using SystemKey = std::pair<Priority, std::string>;
359 using SystemContainer = std::map<SystemKey, std::shared_ptr<Scene::System>, std::greater<>>;
361 SystemContainer::const_iterator findSystem(
const std::string& name )
const;
362 SystemContainer::iterator findSystem(
const std::string& name );
368 SystemContainer m_systems;
370 std::vector<std::shared_ptr<Core::Asset::FileLoaderInterface>> m_fileLoaders;
372 std::unique_ptr<Rendering::RenderObjectManager> m_renderObjectManager;
373 std::unique_ptr<Scene::EntityManager> m_entityManager;
374 std::unique_ptr<Scene::SignalManager> m_signalManager;
375 std::unique_ptr<Data::TextureManager> m_textureManager;
376 std::unique_ptr<Data::ShaderProgramManager> m_shaderProgramManager;
377 std::unique_ptr<Core::Asset::FileData> m_loadedFile;
379 bool m_loadingState {
false };
382 std::string m_resourcesRootDir;
390 FboAndViewport(
int fbo, std::array<int, 4>&& viewport ) :
391 m_fbo { fbo }, m_viewport { viewport } {}
393 std::array<int, 4> m_viewport;
397 std::stack<FboAndViewport> m_fboAndViewportStack;
404 void updateTime( Scalar dt );
406 Scalar m_dt { 1_ra / 60_ra };
407 Scalar m_startTime { 0_ra };
408 Scalar m_endTime { 1_ra };
409 Scalar m_time { 0_ra };
410 bool m_play {
false };
411 bool m_singleStep {
true };
412 bool m_realTime {
false };
413 bool m_forwardBackward {
false };
414 bool m_isBackward {
false };
421 std::unique_ptr<globjects::State> m_openglState {
nullptr };
422 std::unique_ptr<Core::TaskQueue> m_gpuTaskQueue {
new Core::TaskQueue( 0 ) };
Utils::Index TaskId
Identifier for a task in the task queue.