当前位置: 首页>>代码示例>>C++>>正文


C++ Core::Init方法代码示例

本文整理汇总了C++中Core::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ Core::Init方法的具体用法?C++ Core::Init怎么用?C++ Core::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Core的用法示例。


在下文中一共展示了Core::Init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

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;
}
开发者ID:SleepWalk2,项目名称:JadeStern,代码行数:26,代码来源:main.cpp

示例2: main

int main()
{
	Core core;
	core.Init();
	core.Run();
	core.Finish();
	return 0;
}
开发者ID:LeapTable,项目名称:API,代码行数:8,代码来源:ApiLeapMotion.cpp

示例3: main

int main(int argc, char** argv)
{
	Core* core = new Core(argc, argv);
	core->Init(1280, 720);
	core->Run();
	core->Destroy();
	delete core;
	return 0;
}
开发者ID:mini-tbnn,项目名称:engine,代码行数:9,代码来源:main.cpp

示例4: main

INITIALIZE_EASYLOGGINGPP

int main()
{
    LOG(INFO) << "My first info log using default logger";
    Core* game = new Core();
    game->Init();
    game->Run();
    return 0;
}
开发者ID:AaccrraA,项目名称:Vorpal-Engine,代码行数:10,代码来源:Main.cpp

示例5: _tmain

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;
}
开发者ID:Waluario,项目名称:Suit-Em-Up,代码行数:18,代码来源:Main.cpp

示例6: setup

/** 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;
}
开发者ID:beorc,项目名称:flare_star,代码行数:86,代码来源:AApplication.cpp


注:本文中的Core::Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。