Пример #1
0
//----------------------------------------------------------------//
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
0
//----------------------------------------------------------------//
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
0
//----------------------------------------------------------------//
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
0
//----------------------------------------------------------------//
void MOAIDraw::DrawRectFill ( USRect rect ) {

	rect.Bless ();
	MOAIDraw::DrawRectFill ( rect.mXMin, rect.mYMin, rect.mXMax, rect.mYMax );
}