本文整理汇总了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;
}
示例2: main
int main()
{
Core core;
core.Init();
core.Run();
core.Finish();
return 0;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}