本文整理汇总了C++中USRect::Bless方法的典型用法代码示例。如果您正苦于以下问题:C++ USRect::Bless方法的具体用法?C++ USRect::Bless怎么用?C++ USRect::Bless使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USRect
的用法示例。
在下文中一共展示了USRect::Bless方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawRectEdges
//----------------------------------------------------------------//
void MOAIDraw::DrawRectEdges ( USRect rect, u32 edges ) {
rect.Bless ();
MOAILineBrush glLine;
// right
if ( edges & USRect::kRight ) {
glLine.SetVerts ( rect.mXMax, rect.mYMin, rect.mXMax, rect.mYMax );
glLine.Draw ();
}
// top
if ( edges & USRect::kTop ) {
glLine.SetVerts ( rect.mXMin, rect.mYMin, rect.mXMax, rect.mYMin );
glLine.Draw ();
}
// left
if ( edges & USRect::kLeft ) {
glLine.SetVerts ( rect.mXMin, rect.mYMin, rect.mXMin, rect.mYMax );
glLine.Draw ();
}
// bottom
if ( edges & USRect::kBottom ) {
glLine.SetVerts ( rect.mXMin, rect.mYMax, rect.mXMax, rect.mYMax );
glLine.Draw ();
}
}
示例2: SetScissorRect
//----------------------------------------------------------------//
void MOAIGfxDevice::SetScissorRect ( USRect rect ) {
rect.Bless ();
USRect& current = this->mScissorRect;
if ( ( current.mXMin != rect.mXMin ) ||
( current.mYMin != rect.mYMin ) ||
( current.mXMax != rect.mXMax ) ||
( current.mYMax != rect.mYMax )) {
this->Flush ();
USRect deviceRect = this->mFrameBuffer->WndRectToDevice ( rect );
GLint x = ( GLint )deviceRect.mXMin;
GLint y = ( GLint )deviceRect.mYMin;
GLsizei w = ( GLsizei )( deviceRect.Width () + 0.5f );
GLsizei h = ( GLsizei )( deviceRect.Height () + 0.5f );
glScissor ( x, y, w, h );
this->mScissorRect = rect;
glEnable ( GL_SCISSOR_TEST );
}
}
示例3: DrawRectEdges
//----------------------------------------------------------------//
void MOAIDraw::DrawRectEdges ( USRect rect, u32 edges ) {
rect.Bless ();
// right
if ( edges & USRect::kRight ) {
MOAIDraw::DrawLine ( rect.mXMax, rect.mYMin, rect.mXMax, rect.mYMax );
}
// top
if ( edges & USRect::kTop ) {
MOAIDraw::DrawLine ( rect.mXMin, rect.mYMin, rect.mXMax, rect.mYMin );
}
// left
if ( edges & USRect::kLeft ) {
MOAIDraw::DrawLine ( rect.mXMin, rect.mYMin, rect.mXMin, rect.mYMax );
}
// bottom
if ( edges & USRect::kBottom ) {
MOAIDraw::DrawLine ( rect.mXMin, rect.mYMax, rect.mXMax, rect.mYMax );
}
}
示例4: DrawRectFill
//----------------------------------------------------------------//
void MOAIDraw::DrawRectFill ( USRect rect ) {
rect.Bless ();
MOAIDraw::DrawRectFill ( rect.mXMin, rect.mYMin, rect.mXMax, rect.mYMax );
}