Ejemplo n.º 1
0
int main(void)
{
	Core* core = new Core();

	if(core->Init())
	{
		Viewport* vp0 = core->GetRenderer()->CreateViewport("MainViewport", 0, 0, 640, 720);
		core->GetRenderer()->CreateViewport("SecondaryViewport", 640, 0, 640, 720);

		Entity* e = new Entity();
		e->AddComponent<Transform>();
		vp0->SetCamera(e->AddComponent<Camera>());

		Entity* text = new Entity();
		text->AddComponent<Transform>();
		text->AddComponent<TextRenderable>();
		text->GetComponent<TextRenderable>()->SetText("Suiseiseki loves you desu.");

		core->Start();
	}

	

	delete core;
	return 0;
}
Ejemplo n.º 2
0
int main()
{
	Core core;
	core.Init();
	core.Run();
	core.Finish();
	return 0;
}
Ejemplo n.º 3
0
int main(int argc, char** argv)
{
	Core* core = new Core(argc, argv);
	core->Init(1280, 720);
	core->Run();
	core->Destroy();
	delete core;
	return 0;
}
Ejemplo n.º 4
0
INITIALIZE_EASYLOGGINGPP

int main()
{
    LOG(INFO) << "My first info log using default logger";
    Core* game = new Core();
    game->Init();
    game->Run();
    return 0;
}
Ejemplo n.º 5
0
int _tmain(int argc, _TCHAR* argv[]){
	Core Game;
	const unsigned int t = 5;

	for (int i = 0; i < t; i++){
		if (Game.Init()){
			Game.Run();
			Game.Cleanup();
			break;
		}
		else {
			std::cout << "Initializing error : " << t - 1 << " tries left.\n";
			Game.Cleanup();
		}
	}
	
	return 0;
}
Ejemplo n.º 6
0
/** Sets up the application - returns false if the user chooses to abandon configuration. */
bool AApplication::setup(void)
{
    mRoot = new Root();

    setupResources("media/common/");

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();

    // Set default mipmap level (NB some APIs ignore this)
    TextureManager::getSingleton().setDefaultNumMipmaps(5);

    ResourceGroupManager::getSingleton().initialiseResourceGroup("Bootstrap");
    ResourceGroupManager::getSingleton().initialiseResourceGroup(GUI_RESOURCE_GROUP);
    ResourceGroupManager::getSingleton().initialiseResourceGroup("General");

    ScriptsCamera = mSceneMgr->createCamera("ScriptsCamera");
    ScriptsCamera->setNearClipDistance(5);
    ScriptsCamera->setFarClipDistance(0);

    CombatCamera = mSceneMgr->createCamera("CombatCamera");
    CombatCamera->setNearClipDistance(5);
    CombatCamera->setFarClipDistance(0);

    Ogre::SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
    node->attachObject(ScriptsCamera);

    createCamera();
    createViewports();

    Core *Instance = Core::GetInstance();
    Instance->SetSceneManager(mSceneMgr);
    Instance->SetApplication(this);

    InitGui();

    if (0!=Instance->Init())
        return false;

    //CurrentListener = GUISystem::GetInstance();
    //mRoot->addFrameListener(CurrentListener);

    /*MaterialPtr fade = Ogre::MaterialManager::getSingleton().create("FadeMaterial", "General");
    fade->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);*/

    createFrameListener();

    AACommandsFrameListener *commands_listener = AACommandsFrameListener::GetInstance();
    commands_listener->Init(mWindow);
    commands_listener->SetCurrentHandler(Instance);
    mRoot->addFrameListener(commands_listener);

    EditorFrameListener *editor_listener = EditorFrameListener::GetInstance();
    editor_listener->Init(mWindow);

    CombatFrameListener::GetInstance()->Init(mWindow);

    ComixFrameListener::GetInstance()->Init(mWindow);
    //SetCurrentGameState(AApplication::GS_STUDIOINTRO);
    SetCurrentGameState(AApplication::GS_COMIX);

    ComixFrameHandler *handler = new ComixFrameHandler();
    TiXmlElement *xml = ObjectsLibrary::GetParsed("logo_intro.xml");
    handler->Parse(xml);
    delete xml;
    ComixFrameListener *listener = ComixFrameListener::GetInstance();
    listener->SetCurrentHandler(handler);

    CommonDeclarations::PlayIntroMusic(true);

    //handler->Show(0);
    //handler->SetActive(0, true);

    //handler->Show(1);
    //handler->SetActive(1, true);

    //SetCurrentGameState(AApplication::GS_GUI);
    //GUISystem::GetInstance()->GetIntroMenu()->Show();

    //GUISystem::GetInstance()->Show();

    return true;
}