本文整理汇总了C++中samplerenderer::Renderer::drawLines2D方法的典型用法代码示例。如果您正苦于以下问题:C++ Renderer::drawLines2D方法的具体用法?C++ Renderer::drawLines2D怎么用?C++ Renderer::drawLines2D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类samplerenderer::Renderer
的用法示例。
在下文中一共展示了Renderer::drawLines2D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: customizeRender
void SampleParticles::customizeRender()
{
SampleRenderer::Renderer* renderer = getRenderer();
// render the sight
SampleRenderer::RendererColor sightColor(200, 40, 40, 127);
PxReal sight[] = { 0.47f, 0.50f, 0.49f, 0.50f, // line 1
0.51f, 0.50f, 0.53f, 0.50f, // line 2
0.50f, 0.47f, 0.50f, 0.49f, // line 3
0.50f, 0.51f, 0.50f, 0.53f // line 4
};
renderer->drawLines2D(2, sight, sightColor);
renderer->drawLines2D(2, sight + 4, sightColor);
renderer->drawLines2D(2, sight + 8, sightColor);
renderer->drawLines2D(2, sight + 12, sightColor);
//settings for right lower corner info text (same hight as fps display)
const PxU32 yInc = 18;
const PxReal scale = 0.5f;
const PxReal shadowOffset = 6.0f;
PxU32 width, height;
renderer->getWindowSize(width, height);
PxU32 y = height-2*yInc;
PxU32 x = width - 240;
if (mLoadTextAlpha > 0)
{
const RendererColor textColor(255, 0, 0, PxU8(mLoadTextAlpha*255.0f));
const char* message[3] = { "Particle count: Moderate", "Particle count: Medium", "Particle count: High" };
renderer->print(x, y, message[mParticleLoadIndex], scale, shadowOffset, textColor);
y -= yInc;
}
#if PX_SUPPORT_GPU_PHYSX
{
const RendererColor textColor(255, 0, 0, 255);
renderer->print(x, y, mRunOnGpu ? "Running on GPU" : "Running on CPU", scale, shadowOffset, textColor);
}
#endif
}