本文整理汇总了C++中Performance::DrawPerformance方法的典型用法代码示例。如果您正苦于以下问题:C++ Performance::DrawPerformance方法的具体用法?C++ Performance::DrawPerformance怎么用?C++ Performance::DrawPerformance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Performance
的用法示例。
在下文中一共展示了Performance::DrawPerformance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPerformanceBar
//-----------------------------------------------------------------------------
//! 描画
//-----------------------------------------------------------------------------
void SystemPerformance::drawPerformanceBar()
{
glDepthMask(GL_FALSE);
setBlendMode(BM_BLEND_ALPHA);
// 描画座標
Vector3 drawPos = Vector3(1860.0f, 0.0f, 0.0f);
// フレームの数
static u32 frameCount = 3;
// 線形補完する
static f32 height = 1000.0f;
// 1フレーム分の高さ
static f32 oneFrameHeight = height / (f32)frameCount;
// 枠を描画
glColor4f(0.0f,0.0f,0.0f, 0.8f);
glBegin(GL_TRIANGLE_STRIP);
glVertex3f(drawPos._x , drawPos._y , 0.0f);
glVertex3f(drawPos._x + 40.0f, drawPos._y , 0.0f);
glVertex3f(drawPos._x , drawPos._y + height, 0.0f);
glVertex3f(drawPos._x + 40.0f, drawPos._y + height, 0.0f);
glEnd();
// 枠の分だけずらす
drawPos._x += 5.0f;
// 描画
for( list<Performance*>::iterator itr = _pPerformList.begin(); itr != _pPerformList.end(); itr++ )
{
Performance* drawPef = *itr;
// 描画
drawPef->DrawPerformance(drawPos, oneFrameHeight, _maxSecond);
// 次の描画位置を求める
drawPos._y += drawPef->getHeight();
}
//---- フレームの分割線の描画
drawPos._x -= 5.0f;
glBegin(GL_LINES);
glColor4f(0.0f, 1.0f, 0.5f, 1.0f);
for( u32 i=0; i<frameCount; ++i ){
glVertex3f(drawPos._x , i * oneFrameHeight, 0.0f);
glVertex3f(drawPos._x + 40.0f, i * oneFrameHeight, 0.0f);
}
glEnd();
// 白で設定しなおす
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
setBlendMode(BM_NONE);
glDepthMask(GL_TRUE);
}
示例2: DrawPerformance
//-----------------------------------------------------------------------------
//! 描画
//-----------------------------------------------------------------------------
void Performance::DrawPerformance(Vector3 drawPos, f32& parentHeight, s64& maxFrame)
{
// 線形補完する
_height = LinearInterpolation(0.0f, parentHeight, (f32)_totalTime, (f32)maxFrame);
// 自分のバーの描画
glBegin(GL_TRIANGLE_STRIP);
glColor4ubv((GLubyte*)&_drawColor);
glVertex3f(drawPos._x , drawPos._y , 0.0f);
glVertex3f(drawPos._x + 30.0f, drawPos._y , 0.0f);
glVertex3f(drawPos._x , drawPos._y + _height, 0.0f);
glVertex3f(drawPos._x + 30.0f, drawPos._y + _height, 0.0f);
glEnd();
// 子のパフォーマンスの描画
for( list<Performance*>::iterator itr = _childPeform.begin(); itr != _childPeform.end(); itr++ )
{
Performance* drawPef = *itr;
// 描画
drawPef->DrawPerformance(drawPos, _height, _totalTime);
// 次の描画位置を求める
drawPos._y += drawPef->getHeight();
}
}