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();
}
Beispiel #2
0
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();
}
	void loop() {
		boost::asio::io_service::work work(getIoService());
		while (isAlive()) {
			boost::system::error_code ec;
			getIoService().reset();
			if (!getIoService().run(ec)) {
				std::this_thread::sleep_for(std::chrono::milliseconds(10));
			}
		}
		*mLog.debug() << UTILS_STR_FUNCTION << ", done";
	}
int main(int argc, char* args []) {
	// Initialize Logger
	Utils::ILoggingManager *loggingManager = new Utils::LoggingManager("./Logs/WorldServer.log");
	Utils::Logger logger = loggingManager->CreateLogger("Loader");

	logger.LogHighlight("Initializing all World Server Modules...");

	// Set up Network Module
	Server::Network::INetwork *network = Server::RakNetNetwork::LoadNetwork(*loggingManager, 6789, 16);

	logger.LogHighlight("All Engine Modules Initialized");
	logger.LogHighlight("Initializing World Server...");

	// Initialize World Server
	Server::Core::WorldServer worldServer(loggingManager, network);

	logger.LogHighlight("World Server Initialized");

	// Run World Server
	worldServer.Execute();
}