本文整理汇总了C++中Quad::getBounds方法的典型用法代码示例。如果您正苦于以下问题:C++ Quad::getBounds方法的具体用法?C++ Quad::getBounds怎么用?C++ Quad::getBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quad
的用法示例。
在下文中一共展示了Quad::getBounds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
Port::frameRect(const Quad& quad, Color rgba) {
PortImpl& port = static_cast<PortImpl&>(*this); // get us access to our private data
if (quad.getBounds().intersection(port.drawableRect()).empty()) return; // exit early if completely clipped
port.setOpenGLModesForDrawing((rgba.alpha < 1.0f)); // sets up clip rect too
glColor4f ( (float) rgba.red, rgba.green, rgba.blue, rgba.alpha);
glBegin(GL_LINE_LOOP);
glVertex2f( quad.points[lftBot].x, quad.points[lftBot].y );
glVertex2f( quad.points[rgtBot].x, quad.points[rgtBot].y );
glVertex2f( quad.points[rgtTop].x, quad.points[rgtTop].y );
glVertex2f( quad.points[lftTop].x, quad.points[lftTop].y );
glEnd();
/* for some reason this mode generates a lot of flicker... possibly because it is drawing directly to the screen and not to the back buffer?
GLshort thePoints[] = {
rect.left, rect.top, // origin of the line
rect.right, rect.top, // next line segment
rect.right, rect.bottom, // next line segment
rect.left, rect.bottom // next line segment and back to first
};
glVertexPointer(2, GL_SHORT, 0, thePoints);
glDrawArrays(GL_LINE_LOOP, 0, 4);
*/
port.mNeedRedraw = true;
gPortDirty = true;
}