本文整理汇总了C++中GraphicsDevice::restoreState方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsDevice::restoreState方法的具体用法?C++ GraphicsDevice::restoreState怎么用?C++ GraphicsDevice::restoreState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsDevice
的用法示例。
在下文中一共展示了GraphicsDevice::restoreState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateRender
void GameLoop::updateRender(RenderContext &rc) {
const DisplayCaps settings = m_window.getSettings();
const core::math::Vec2f screenDims((f32) settings.m_width, (f32) settings.m_height);
SceneManager &sm = m_instance.m_sm;
CameraSystem &cameraSys = m_instance.m_cameraSys;
GraphicsDevice gd;
//---------------------
rc.m_fboGBuffer.activate();
// TODO(kulseran): defer rendering pass
rc.m_fboGBuffer.deactivate();
//---------------------
/*
camera.update((f32) ticker.dt(), settings.m_width, settings.m_height, m_inputManager);
fsengine::render::MeshBuffer mesh = drawPrim.beginMesh(fsengine::render::eDrawLayer::DRAW_LAYER_WORLD_DIFUSE, *debugMaterial);
fsengine::render::MeshBuilder builder(mesh);
core::math::Matrix44 impactLoc = core::math::G_IdentityMatrix44;
impactLoc.pos() = core::math::G_ZeroVector4;
impactLoc.at() *= 0.5;
impactLoc.up() *= 0.5;
impactLoc.left() *= 0.5;
builder.insertCube(impactLoc, core::math::Color(100, 196, 64, 128));
drawPrim.endMesh(mesh);
cameraSys.addCamera(camera);
cameraSys.update(screenDims);
drawPrim.prerender(sm, fsengine::render::eDrawLayer::DRAW_LAYER_WORLD_DIFUSE);
sm.render(fsengine::render::eDrawLayer::DRAW_LAYER_WORLD_DIFUSE, cameraSys, gd);
debugDraw.render(camera);
debugDraw.clear();
drawPrim.clear();
*/
// Render Hud
fsengine::hud::HudCamera cameraHud(screenDims);
cameraSys.addCamera(cameraHud);
cameraSys.update(screenDims);
gd.clearDepth();
HudContainer &hud = m_instance.m_hud;
hud.update(1.0f / 60.0f, screenDims, m_inputManager);
hud.prerender(sm, fsengine::render::eDrawLayer::DRAW_LAYER_HUD_BASE);
hud.prerender(sm, fsengine::render::eDrawLayer::DRAW_LAYER_HUD_ICONS);
hud.prerender(sm, fsengine::render::eDrawLayer::DRAW_LAYER_HUD_TEXT);
hud.prerender(sm, fsengine::render::eDrawLayer::DRAW_LAYER_HUD_CURSOR);
sm.render(fsengine::render::eDrawLayer::DRAW_LAYER_HUD_BASE, cameraSys, gd);
sm.render(fsengine::render::eDrawLayer::DRAW_LAYER_HUD_ICONS, cameraSys, gd);
sm.render(fsengine::render::eDrawLayer::DRAW_LAYER_HUD_TEXT, cameraSys, gd);
sm.render(fsengine::render::eDrawLayer::DRAW_LAYER_HUD_CURSOR, cameraSys, gd);
// Finish
sm.clear();
gd.restoreState(fsengine::device::GraphicsState());
CHECK(gd.verify());
}