コード例 #1
0
int main(int argc, char* args []) {
	// Initialize Logger
	Utils::ILoggingManager *loggingManager = new Utils::LoggingManager("./Logs/Client.log");
	Utils::Logger logger = loggingManager->CreateLogger("Loader");

	logger.LogHighlight("Initializing all Engine Modules...");

	// Initialize Engine
	Core::Engine engine(loggingManager);
	
	// Set up Content Module
	Content::Content *content = new Content::Content(*loggingManager);
	engine.SetContent(content);

	// Set up Context Module
	Context::IContext *context = GLFWContext::LoadContext();
	engine.SetContext(context);

	// Set up Graphics Module
	Graphics::IGraphics *graphics = OpenGLGraphics::LoadGraphics(context->GetMainWindow(), *content);
	engine.SetGraphics(graphics);

	// Set up Input Module
	Input::Input *input = new Input::Input(*context, *graphics);
	engine.SetInput(input);

	// Set up Network Module
	Network::INetwork *network = RakNetNetwork::LoadNetwork(*loggingManager);
	engine.SetNetwork(network);

	// Set up GUI Module
	GUI::IGUI *gui = CoherentUIOpenGLUI::LoadGUI(*loggingManager, *input);
	engine.SetGUI(gui);

	// Set up State Engine
	StateEngine::StateEngine *stateEngine = new StateEngine::StateEngine(engine);
	engine.SetStateEngine(stateEngine);

	logger.LogHighlight("All Engine Modules Initialized");
	logger.LogHighlight("Queueing Default State Initialization...");

	// Set Default State
	MainMenuState::SwitchToState(*stateEngine);

	logger.LogHighlight("Executing Main Loop...");

	// Run Engine
	engine.Execute();
}
コード例 #2
0
ファイル: Main.cpp プロジェクト: jornedesmedt/SquareCubedTest
int main(int argc, char* args [])
{
	// Initialize Logger
	Utils::ILoggingManager *loggingManager = new Utils::LoggingManager();
	Utils::Logger logger = loggingManager->CreateLogger("Loader");

	logger.LogHighlight("Initializing all engine modules...");

	// Initialize Engine
	Core::Engine engine(loggingManager);
	
	// Set up Content Module
	Content::IContent *content = DefaultContent::LoadContent();
	engine.SetContent(content);

	// Set up Context Module
	Context::IContext *context = GLFWContext::LoadContext();
	engine.SetContext(context);

	// Set up Graphics Module
	Graphics::IGraphics *graphics = OpenGLGraphics::LoadGraphics(context->GetMainWindow(), *content);
	engine.SetGraphics(graphics);

	// Set up Input Module
	Input::IInput *input = DefaultInput::LoadInput(*context);
	engine.SetInput(input);

	// Set up Network Module
	Network::INetwork *network = RakNetNetwork::LoadNetwork(loggingManager->CreateLogger("Network"));
	engine.SetNetwork(network);

	// Set up State Engine
	StateEngine::IStateEngine *stateEngine = DefaultStateEngine::LoadStateEngine(engine);
	engine.SetStateEngine(stateEngine);

	logger.LogHighlight("All engine modules initialized!");
	logger.LogHighlight("Initializing default state...");

	// Set Default State
	MainMenuState::ImmediateSwitchToState(*stateEngine);

	logger.LogHighlight("Default state initialized!");

	// Run Engine
	engine.Execute();
}