本文整理汇总了C++中DataManager::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ DataManager::Get方法的具体用法?C++ DataManager::Get怎么用?C++ DataManager::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Enable
void TerrainWrapper::Enable()
{
Controller * ctrl = static_cast<Controller*>(GetManager()->Get("Controller"));
DataManager * dm = static_cast<DataManager*>(GetManager()->Get("DataManager"));
Techniques * tech = static_cast<Techniques*>(dm->Get("Techniques"));
ResourceLoader * res = static_cast<ResourceLoader*>(dm->Get("Resources"));
Environment * env = static_cast<Environment*>(res->Get("Environment"));
Camera * camera = static_cast<Camera*>(ctrl->Get("Camera"));
View * view = camera->GetView();
ViewInfo * info = camera->GetInfo();
Shader::Enable();
Shader::Set("myTextureSampler", 0);
Shader::Set("myTextureSampler2", 1);
Shader::Set("myTextureSampler3", 2);
Shader::Set("shadow_map", 3);
TerrainShader::SendTextureAttributes(terra->GetTextureAttributes(), 4);
/**
Raising to power for gamma correction
*/
getLight()->SetFog(glm::pow(env->fog_color, glm::vec3(2.2)), env->fog_density);
getLight()->SetDirectionalLight(env->terrain_bright*
glm::pow(env->sun_color, glm::vec3(2.2)),
env->sun_dir,
env->terrain_ambient,
env->terrain_diffuse);
Set("LightMatrix", Math::GetBiasMatrix()*
tech->GetShadow()->GetDirectionalShadow(env, info, view));
tech->GetShadow()->GetShadowMap()->BindTexture(0, GL_TEXTURE3);
tech->GetShadow()->GetShadowMap()->ResetTextureState();
ManagePlayerCollision(ctrl, false);
}
示例2: Render
void TerrainWrapper::Render()
{
Controller * ctrl = static_cast<Controller*>(GetManager()->Get("Controller"));
DataManager * dm = static_cast<DataManager*>(GetManager()->Get("DataManager"));
Techniques * tech = static_cast<Techniques*>(dm->Get("Techniques"));
ResourceLoader * res = static_cast<ResourceLoader*>(dm->Get("Resources"));
Environment * env = static_cast<Environment*>(res->Get("Environment"));
Camera * camera = static_cast<Camera*>(ctrl->Get("Camera"));
View * view = camera->GetView();
ViewInfo * info = camera->GetInfo();
if (tech->GetSSAO()->OnGeometryPass())
{
tech->GetSSAO()->SetGeometryPassUniforms(view->getCamera(),
view->getViewMatrix());
}
else if (tech->GetShadow()->OnShadowPass())
{
tech->GetShadow()->UniformMVP(tech->GetShadow()->GetDirectionalShadow(env, info, view));
}
else
{
Space(glm::mat4(1.0), view);
}
terra->Render(camera->GetFrustum(), false);
}
示例3: Init
void RootUI::Init()
{
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
Root = wmgr.loadLayoutFromFile("ui.layout");
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(Root);
Controller * ctrl = static_cast<Controller*>(GetManager()->Get("Controller"));
DataManager * dm = static_cast<DataManager*>(GetManager()->Get("DataManager"));
ResourceLoader * res = static_cast<ResourceLoader*>(dm->Get("Resources"));
root_settings = new RootSettings(res, Root);
top_root = new TopRoot(dm, Root);
}
示例4: connect
AutoOnline::AutoOnline(DataManager &data, DataManager &sensitive_data) :
data_(data),
sensitive_data_(sensitive_data),
enabled_(data_.GetBool("online_enabled")),
url_(sensitive_data_.Get("online_url")),
process_script_(data.Get("process_script")),
previous_status_(true) // set to true to force first refresh
{
timer_.setInterval(kOnlineCheckInterval);
connect(&timer_, &QTimer::timeout, this, &AutoOnline::Check);
if (enabled_) {
timer_.start();
Check();
}
}
示例5: Enable
void SkyWrapper::Enable()
{
Controller * ctrl = static_cast<Controller*>(GetManager()->Get("Controller"));
DataManager * dm = static_cast<DataManager*>(GetManager()->Get("DataManager"));
ResourceLoader * res = static_cast<ResourceLoader*>(dm->Get("Resources"));
Environment * env = static_cast<Environment*>(res->Get("Environment"));
Camera * camera = static_cast<Camera*>(ctrl->Get("Camera"));
ViewInfo * info = camera->GetInfo();
View * view = camera->GetView();
glm::mat4 m_rot = Math::Rotate(0, glfwGetTime() / 150.0, 0);
glm::mat4 ModelMatrix = Math::Translation(info->getCameraPos() - info->getDirection()*info->getDistance())*
m_rot*
Math::Scale(glm::vec3(info->getRenderDistance()));
Shader::Enable();
Shader::Set("cube", 0);
Shader::Set("MVP", view->getCamera()*ModelMatrix);
Shader::Set("MV", view->getViewMatrix() * ModelMatrix);
glm::vec4 f = glm::vec4(env->fog_color, 1.0);
Shader::Set("fog_color", f);
SkyRender::Enable();
Shader::Stop();
}
示例6: Init
void TerrainWrapper::Init()
{
DataManager * dm = static_cast<DataManager*>(GetManager()->Get("DataManager"));
ResourceLoader * res = static_cast<ResourceLoader*>(dm->Get("Resources"));
terra = new Terrain();
terra->LoadChunks(res->GetTerrainFile());
terra->LoadColorFiles(res->GetColorFile(),
res->GetTFile(),
res->GetNFile(),
res->GetAFile());
dm->SetTree(terra->GetTree());
}
示例7: Render
void MeshDrawer::Render()
{
Controller * ctrl = static_cast<Controller*>(GetManager()->Get("Controller"));
DataManager * dm = static_cast<DataManager*>(GetManager()->Get("DataManager"));
MeshShader * shader = static_cast<MeshShader*>((GetManager()->Get("Pipeline"))->Get("MeshWrapper"));
Techniques * tech = static_cast<Techniques*>(dm->Get("Techniques"));
EntityManager * entity_manager = static_cast<EntityManager*>(Get("EntityManager"));
EntityPalette * entity_palette = static_cast<EntityPalette*>(Get("EntityPalette"));
shader->SetSpecular(0.0f, 1.0f);
if (tech->GetShadow()->OnShadowPass())
{
glCullFace(GL_FRONT);
entity_manager->Enable();
entity_palette->Enable();
glCullFace(GL_BACK);
}
else
{
entity_manager->Enable();
entity_palette->Enable();
}
}