Пример #1
0
void InfoWindow::drawDivider( float yVal )
{
	gos_VERTEX v[2];

//	gos_SetRenderState( gos_State_AlphaMode, gos_Alpha_AlphaInvAlpha );

	gos_SetRenderState( gos_State_Specular,FALSE );

	gos_SetRenderState( gos_State_AlphaTest, 0 );
		
	gos_SetRenderState( gos_State_Texture, 0 );

	gos_SetRenderState( gos_State_Filter, gos_FilterNone );


	memset( v, 0, sizeof( gos_VERTEX ) * 2 );
	for ( int i = 0; i < 2; i++ )
		v[i].rhw = .5f;

	v[0].x = DIVIDERLEFT;
	v[0].y = v[1].y = yVal;
	v[1].x = DIVIDERRIGHT;
	v[0].argb = v[1].argb = DIVIDERCOLOR;

 	gos_DrawLines( v, 2 );

}
Пример #2
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
	SortData::DrawLineCloud()
{
	Verify(texture2==0);
	Start_Timer(GOS_Draw_Time);

	for(int i=0;i<numVertices;i++)
	{
		if(((GOSVertex *)vertices)[i].x > Environment.screenWidth-1)
		{
			((GOSVertex *)vertices)[i].x = static_cast<Scalar>(Environment.screenWidth-1);
		}
		if(((GOSVertex *)vertices)[i].y > Environment.screenHeight-1)
		{
			((GOSVertex *)vertices)[i].y = static_cast<Scalar>(Environment.screenHeight-1);
		}
	}

#ifdef LAB_ONLY
	if(dontSeeMe == true)
#endif
	{
		gos_DrawLines( (GOSVertex *)vertices, numVertices);
	}
	Stop_Timer(GOS_Draw_Time);
}
Пример #3
0
void drawEmptyRect( const GUI_RECT& area, unsigned long leftTopBorderColor, 
							unsigned long rightBottomBorderColor )
{
	gos_VERTEX v[4];

	memset( v,0,sizeof(v) );
	v[0].rhw =  v[1].rhw = v[2].rhw = v[3].rhw = 1.0;

	GUI_RECT clientArea = area;

	if (   (clientArea.left < 0 && clientArea.right < 0 )
		|| (clientArea.right > Environment.screenWidth && clientArea.left > Environment.screenWidth )
		|| (clientArea.top < 0 && clientArea.bottom < 0 )
		|| ( clientArea.top > Environment.screenHeight && clientArea.bottom > Environment.screenHeight ) )
		return;

	if ( clientArea.left < 0 )
		clientArea.left = 0;

	if ( clientArea.right < 0 )
		clientArea.right = 0;

	if ( clientArea.top < 0 )
		clientArea.top = 0;

	if ( clientArea.bottom < 0 )
		clientArea.bottom = 0;

	if ( clientArea.left >= Environment.screenWidth - 1 )
		clientArea.left = Environment.screenWidth - 1;

	if ( clientArea.right >= Environment.screenWidth - 1 )
		clientArea.right = Environment.screenWidth - 1;

	if ( clientArea.top >= Environment.screenHeight - 1 )
		clientArea.top = Environment.screenHeight - 1;

	if ( clientArea.bottom >= Environment.screenHeight - 1 )
		clientArea.bottom = Environment.screenHeight - 1;

	gos_SetRenderState( gos_State_Texture, 0 );
	gos_SetRenderState( gos_State_ZWrite, 0 );
	gos_SetRenderState( gos_State_ZCompare, 0 );
	gos_SetRenderState( gos_State_AlphaMode, gos_Alpha_AlphaInvAlpha );


	v[0].x		= (float)(clientArea.left);
	v[0].y		= (float)(clientArea.top);
	v[0].argb	= leftTopBorderColor;

	v[1].x		= (float)(clientArea.right);
	v[1].y		= (float)(clientArea.top);
	v[1].argb	= leftTopBorderColor;

	v[2] = v[0];

	v[3].x		= (float)(clientArea.left);
	v[3].y		= (float)(clientArea.bottom);
	v[3].argb	= leftTopBorderColor;

	gos_DrawLines( v, 4 );
	
	v[0].x		= (float)(clientArea.right);
	v[0].y		= (float)(clientArea.top);
	v[0].argb	= rightBottomBorderColor;

	v[1].x		= (float)(clientArea.right);
	v[1].y		= (float)(clientArea.bottom);
	v[1].argb	= rightBottomBorderColor;

	v[3] = v[1];

	v[3].x += 1;

	v[2].x		= (float)(clientArea.left);
	v[2].y		= (float)(clientArea.bottom) + .1/256.f;
	v[2].argb	= rightBottomBorderColor;


	gos_DrawLines( v, 4 );

}