本文整理汇总了C++中rect::x1方法的典型用法代码示例。如果您正苦于以下问题:C++ rect::x1方法的具体用法?C++ rect::x1怎么用?C++ rect::x1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rect
的用法示例。
在下文中一共展示了rect::x1方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: submit_delayed_expose
void window::submit_delayed_expose( const rect &r )
{
/// \todo { Need to fix the local vs screen coordinates }
RECT rect = { LONG( std::floor( r.x1() ) ), LONG( std::floor( r.y1() ) ), LONG( std::ceil( r.x2() ) ), LONG( std::ceil( r.y2() ) ) };
if ( rect.left == rect.top &&
rect.left == rect.right &&
rect.left == rect.bottom )
RedrawWindow( _hwnd, NULL, NULL, RDW_INTERNALPAINT|RDW_UPDATENOW );
else
RedrawWindow( _hwnd, &rect, NULL, RDW_INVALIDATE|RDW_UPDATENOW );
}
示例2: fillRect
void Surface::fillRect(const rect& dst_rect, const Color& color)
{
// XXX do we need to consider ARGB/RGBA ordering issues here.
ASSERT_LOG(dst_rect.x1() >= 0 && dst_rect.x1() <= width(), "destination co-ordinates out of bounds: " << dst_rect.x1() << " : (0," << width() << ")");
ASSERT_LOG(dst_rect.x2() >= 0 && dst_rect.x2() <= width(), "destination co-ordinates out of bounds: " << dst_rect.x2() << " : (0," << width() << ")");
ASSERT_LOG(dst_rect.y1() >= 0 && dst_rect.y1() <= height(), "destination co-ordinates out of bounds: " << dst_rect.y1() << " : (0," << height() << ")");
ASSERT_LOG(dst_rect.y2() >= 0 && dst_rect.y2() <= height(), "destination co-ordinates out of bounds: " << dst_rect.y2() << " : (0," << height() << ")");
unsigned char* pix = reinterpret_cast<unsigned char*>(pixelsWriteable());
const int bpp = pf_->bytesPerPixel();
for(int y = dst_rect.x1(); y < dst_rect.x2(); ++y) {
for(int x = dst_rect.y1(); x < dst_rect.y2(); ++x) {
unsigned char* p = &pix[(y * width() + x) * bpp];
// XXX FIXME
//uint32_t pixels;
//pf_->encodeRGBA(&pixels, color.r(), color.g(), color.b(), color.a());
switch(bpp) {
case 1: p[0] = color.r_int(); break;
case 2: p[0] = color.r_int(); p[1] = color.g_int(); break;
case 3: p[0] = color.r_int(); p[1] = color.g_int(); p[2] = color.b_int(); break;
case 4: p[0] = color.r_int(); p[1] = color.g_int(); p[2] = color.b_int(); p[3] = color.a_int(); break;
}
}
}
}
示例3: SimpleRenderable
explicit SimpleRenderable(const rect& r, const KRE::Color& color)
: KRE::SceneObject("simple_renderable")
{
init();
setColor(color);
const float vx1 = static_cast<float>(r.x1());
const float vy1 = static_cast<float>(r.y1());
const float vx2 = static_cast<float>(r.x2());
const float vy2 = static_cast<float>(r.y2());
std::vector<glm::vec2> vc;
vc.emplace_back(vx1, vy2);
vc.emplace_back(vx1, vy1);
vc.emplace_back(vx2, vy1);
vc.emplace_back(vx2, vy1);
vc.emplace_back(vx2, vy2);
vc.emplace_back(vx1, vy2);
attribs_->update(&vc);
}