本文整理汇总了C++中IVideoDriver::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoDriver::clear方法的具体用法?C++ IVideoDriver::clear怎么用?C++ IVideoDriver::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoDriver
的用法示例。
在下文中一共展示了IVideoDriver::clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void Stage::render(const Color* clearColor, const Rect& viewport, const Matrix& view, const Matrix& proj)
{
Material::setCurrent(0);
IVideoDriver* driver = IVideoDriver::instance;
driver->setViewport(viewport);
if (clearColor)
driver->clear(*clearColor);
STDMaterial& mat = *STDMaterial::instance;
mat.apply(0);
Matrix vp = view * proj;
mat.setViewProj(vp);
timeMS t = getTimeMS();
RenderState rs;
rs.material = _material;
Point ds = core::getDisplaySize();
RectF clip(0.0f, 0.0f, (float)ds.x, (float)ds.y);
rs.clip = &clip;
if (_clipOuter)
{
driver->setScissorRect(&_viewport);
clip = _viewport.cast<RectF>();
}
Actor::render(rs);
mat.finish();
}
示例2: pass
void pass(spNativeTexture srcTexture, const Rect& srcRect, spNativeTexture destTexture, const Rect& destRect, const Color& color)
{
IVideoDriver* driver = IVideoDriver::instance;
const VertexDeclarationGL* decl = static_cast<const VertexDeclarationGL*>(driver->getVertexDeclaration(vertexPCT2::FORMAT));
driver->setRenderTarget(destTexture);
driver->clear(0);
driver->setViewport(destRect);
driver->setTexture(0, srcTexture);
vertexPCT2 v[4];
RectF dst = srcRect.cast<RectF>() / Vector2((float)srcTexture->getWidth(), (float)srcTexture->getHeight());
fillQuadT(v,
dst,
RectF(-1, -1, 2, 2),
AffineTransform::getIdentity(), color.rgba());
driver->draw(IVideoDriver::PT_TRIANGLE_STRIP, decl, v, sizeof(v));
driver->setTexture(0, 0);
}
示例3: update
void PostProcess::update(Actor* actor)
{
_screen = getScreenRect(*actor);
OX_ASSERT(actor->_getStage());
_rt = getRTManager().get(_rt, _screen.getWidth(), _screen.getHeight(), _format);
_transform = actor->computeGlobalTransform().inverted();
IVideoDriver* driver = IVideoDriver::instance;
driver->setRenderTarget(_rt);
Rect vp = _screen;
vp.pos = Point(0, 0);
driver->setViewport(vp);
driver->clear(0);
RenderState rs;
STDMaterial* mat = STDMaterial::instance;
STDRenderer* renderer = mat->getRenderer();
rs.material = mat;
RectF clip = vp.cast<RectF>();
rs.clip = &clip;
renderer->initCoordinateSystem(vp.getWidth(), vp.getHeight(), true);
rs.transform = actor->getParent()->computeGlobalTransform();
if (!(_options._flags & PostProcessOptions::flag_fullscreen))
{
AffineTransform offset;
offset.identity();
offset.translate(-_screen.pos);
rs.transform = rs.transform * offset;
}
mat->Material::render(actor, rs);
mat->finish();
}
示例4: render
void Stage::render(const Color& clearColor, const Rect& viewport)
{
//if (!_active)
// return;
IVideoDriver* driver = IVideoDriver::instance;
driver->setViewport(viewport);
driver->clear(clearColor);
STDRenderer renderer(driver);
renderer.initCoordinateSystem(viewport.getWidth(), viewport.getHeight());
renderer.begin(0);
render(renderer);
renderer.end();
}