当前位置: 首页>>代码示例>>C++>>正文


C++ USRect::Bless方法代码示例

本文整理汇总了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 ();
	}	
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例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 );
	}
}
开发者ID:LOFI,项目名称:moai-dev,代码行数:27,代码来源:MOAIGfxDevice.cpp

示例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 );
	}	
}
开发者ID:LOFI,项目名称:moai-dev,代码行数:25,代码来源:MOAIDraw.cpp

示例4: DrawRectFill

//----------------------------------------------------------------//
void MOAIDraw::DrawRectFill ( USRect rect ) {

	rect.Bless ();
	MOAIDraw::DrawRectFill ( rect.mXMin, rect.mYMin, rect.mXMax, rect.mYMax );
}
开发者ID:LOFI,项目名称:moai-dev,代码行数:6,代码来源:MOAIDraw.cpp


注:本文中的USRect::Bless方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。