本文整理汇总了C++中CColor::FloatArray方法的典型用法代码示例。如果您正苦于以下问题:C++ CColor::FloatArray方法的具体用法?C++ CColor::FloatArray怎么用?C++ CColor::FloatArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CColor
的用法示例。
在下文中一共展示了CColor::FloatArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderTileOutline
void TerrainOverlay::RenderTileOutline(const CColor& colour, int line_width, bool draw_hidden, ssize_t i, ssize_t j)
{
if (draw_hidden)
{
glDisable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
}
else
{
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
}
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
if (line_width != 1)
glLineWidth((float)line_width);
CVector3D pos;
glBegin(GL_QUADS);
glColor4fv(colour.FloatArray());
m_Terrain->CalcPosition(i, j, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j+1, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i, j+1, pos); glVertex3fv(pos.GetFloatArray());
glEnd();
if (line_width != 1)
glLineWidth(1.0f);
}
示例2: RenderTile
void TerrainOverlay::RenderTile(const CColor& colour, bool draw_hidden, ssize_t i, ssize_t j)
{
// TODO: if this is unpleasantly slow, make it much more efficient
// (e.g. buffering data and making a single draw call? or at least
// far fewer calls than it makes now)
if (draw_hidden)
{
glDisable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
}
else
{
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
}
#if CONFIG2_GLES
#warning TODO: implement TerrainOverlay::RenderTile for GLES
#else
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
CVector3D pos;
glBegin(GL_TRIANGLES);
glColor4fv(colour.FloatArray());
if (m_Terrain->GetTriangulationDir(i, j))
{
m_Terrain->CalcPosition(i, j, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i, j+1, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j+1, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i, j+1, pos); glVertex3fv(pos.GetFloatArray());
}
else
{
m_Terrain->CalcPosition(i, j, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j+1, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i+1, j+1, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i, j+1, pos); glVertex3fv(pos.GetFloatArray());
m_Terrain->CalcPosition(i, j, pos); glVertex3fv(pos.GetFloatArray());
}
glEnd();
#endif
}