本文整理汇总了C++中Video::render方法的典型用法代码示例。如果您正苦于以下问题:C++ Video::render方法的具体用法?C++ Video::render怎么用?C++ Video::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: int
void Font_FT::Glyph::render(Video &vr, const Point2f &position, const float &vratio) const {
const float x = int(position.x * vratio + 0.5f) / vratio;
const float y = int(position.y * vratio + 0.5f) / vratio;
Quadrilateral<Vertex2f_Texture> rect(
(Vertex2f_Texture(Point2f(m_upper_left_point.x + x, m_upper_left_point.y + y), m_upper_left_texel)) ,
(Vertex2f_Texture(Point2f(m_upper_left_point.x + x, m_lower_right_point.y + y), Point2f(m_upper_left_texel.x, m_lower_right_texel.y))) ,
(Vertex2f_Texture(Point2f(m_lower_right_point.x + x, m_lower_right_point.y + y), m_lower_right_texel)) ,
(Vertex2f_Texture(Point2f(m_lower_right_point.x + x, m_upper_left_point.y + y), Point2f(m_lower_right_texel.x, m_upper_left_texel.y))) );
vr.render(rect);
}
示例2: rect
void Font_FT::Glyph::render(Video &vr, const Point3f &position, const Vector3f &right, const Vector3f &down) const {
const Vector3f scaled_right = (m_lower_right_point.x - m_upper_left_point.x) * right;
const Vector3f scaled_down = (m_lower_right_point.y - m_upper_left_point.y) * down;
const Point3f &ul = position + m_upper_left_point.x * right + m_upper_left_point.y * down;
const Point3f ll = ul + scaled_down;
const Point3f lr = ll + scaled_right;
const Point3f ur = ul + scaled_right;
Quadrilateral<Vertex3f_Texture> rect(
(Vertex3f_Texture(ul, m_upper_left_texel)) ,
(Vertex3f_Texture(ll, Point2f(m_upper_left_texel.x, m_lower_right_texel.y))) ,
(Vertex3f_Texture(lr, m_lower_right_texel)) ,
(Vertex3f_Texture(ur, Point2f(m_lower_right_texel.x, m_upper_left_texel.y))) );
vr.render(rect);
}