本文整理汇总了C++中RenderElement::GetThickness方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderElement::GetThickness方法的具体用法?C++ RenderElement::GetThickness怎么用?C++ RenderElement::GetThickness使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderElement
的用法示例。
在下文中一共展示了RenderElement::GetThickness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderPrimitives
void RendererOpenGL::RenderPrimitives( const RenderElement& _Primitives )
#endif
{
PROFILING( "Render Primitives" );
#ifdef MULTIPLE_RENDER_ELEMENTS
RenderElementPrimitives::Type eType = _spPrimitives->GetType();
const CFoundation::Color& color = _spPrimitives->GetColor();
Float16 f16Thickness = _spPrimitives->GetThickness();
const RenderElementPrimitives::PointVec& avPoints = _spPrimitives->GetPoints();
#else
RenderElement::Type eType = _Primitives.GetType();
const CFoundation::Color& color = _Primitives.GetColor();
Float16 f16Thickness = _Primitives.GetThickness();
const RenderElement::PointVec& avPoints = _Primitives.GetPoints();
#endif
// Get opengl type
Unsigned32 u32Type = 0;
switch ( eType )
{
#ifdef MULTIPLE_RENDER_ELEMENTS
case RenderElementPrimitives::TYPE_POINTS:
#else
case RenderElement::TYPE_POINTS:
#endif
{
u32Type = GL_POINTS;
}
break;
#ifdef MULTIPLE_RENDER_ELEMENTS
case RenderElementPrimitives::TYPE_LINES:
#else
case RenderElement::TYPE_LINES:
#endif
{
u32Type = GL_LINES;
}
break;
#ifdef MULTIPLE_RENDER_ELEMENTS
case RenderElementPrimitives::TYPE_TRIANGLES:
#else
case RenderElement::TYPE_TRIANGLES:
#endif
{
u32Type = GL_TRIANGLES;
}
break;
#ifdef MULTIPLE_RENDER_ELEMENTS
case RenderElementPrimitives::TYPE_QUADS:
#else
case RenderElement::TYPE_QUADS:
#endif
{
u32Type = GL_QUADS;
}
break;
}
// Set color
Float16 f16R, f16G, f16B, f16A;
color.ToRGBA( f16R, f16G, f16B, f16A );
glColor4f( f16R, f16G, f16B, f16A );
// Set line thickness
glLineWidth( f16Thickness );
// Render primitives
glLoadIdentity();
glDisable( GL_TEXTURE_2D );
glBegin( u32Type );
Unsigned32 u32NumPoints = avPoints.size();
for ( Unsigned32 u32Idx = 0; u32Idx < u32NumPoints; ++u32Idx )
{
const CFoundation::Vector2Df& vPoint = avPoints[ u32Idx ];
glVertex3d( vPoint.GetX(), vPoint.GetY(), 0 );
}
glEnd();
}