#ifdef WIN32 while(timeTwo == timeOne) { timeTwo = std::chrono::high_resolution_clock::now(); }#endif
It just loops until timeTwo is no longer the same as timeOne! Pretty easy fix, I don't plan on removing this until the proper high res timer is implemented in msvc.
So for this time I'll talk about scenes.
Scenes basically just contain entities and the components those entities hold (And what systems those components should go into). You can define a scene something like this:
// Create the sceneScene* myScene = new Scene();// Create an entityToasty::Entity* entity = new Toasty::Entity();// Create a component to attach to the entitytestScript = new DebugInfoTest(gameSystem, entity);// Add entity if it isn't already added and attach the testScript component to it// making sure it goes to the Toasty::BehaviourSystem system.myScene->AttachComponent(entity , "Toasty::BehaviourSystem", testScript);// Then somewhere in the program// This will load the scene and populate the entities into the system// Which will go ahead and give them unique ids and put the components// into systems (if the systems exist in the gamesystem).gameSystem->LoadScene(myScene);// Then somewhere else in the program// Takes out all the entities, components that myScene loaded into the gameSystem.gameSystem->UnloadScene(myScene);
The cool thing about scenes is you can load them while another one is loaded, a use-case for this is kind of memory buckets, breaking up a scene into essential \ non-essential parts so you can load one straight away and then load the next one slowly over many frames. Another thing you can do is inherit from Scene and have your scene manage it's entities and components memory.
At the moment scenes don't copy construct the entities and components instead they directly use the created entities and components. In my next update I'll probably have worked on some sort of rendersystem.