Working on semi proper API to build a scene
This commit is contained in:
		
							
								
								
									
										7
									
								
								BarinkEngine/Scene/Node.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								BarinkEngine/Scene/Node.cpp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
#include "Scene/Node.h"
 | 
			
		||||
 | 
			
		||||
Node::Node(std::string& name) 
 | 
			
		||||
	: name(name), parent(nullptr), children(std::vector<Node*>()) {}
 | 
			
		||||
 | 
			
		||||
Group::Group(std::string& name ) 
 | 
			
		||||
	: Node(name), transform(Transform()) {}
 | 
			
		||||
							
								
								
									
										18
									
								
								BarinkEngine/Scene/SceneManager.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								BarinkEngine/Scene/SceneManager.cpp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
#include "Scene/SceneManager.h"
 | 
			
		||||
 | 
			
		||||
Scene* SceneManager::CreateScene(const std::string& name) 
 | 
			
		||||
{
 | 
			
		||||
	SceneManager::Scenes[name] = new Scene(name);
 | 
			
		||||
 | 
			
		||||
	return &SceneManager::GetScene(name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Scene& SceneManager::GetScene(const std::string& name) 
 | 
			
		||||
{
 | 
			
		||||
	return *SceneManager::Scenes[name];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SceneManager::LoadScene( Scene& scene) 
 | 
			
		||||
{
 | 
			
		||||
	CurrentScene = &scene;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user