示例#1
0
void SdlApplication::onPaint(Fog::Painter& p)
{
	// Just use the Fog-Framework ;-)
	
	// Create some variable we will work with.
	float w = float(_screen->w);
	float h = float(_screen->h);
	
	float roundw = 100.0f;
	float roundh = 100.0f;
	
	Fog::PointF cp(w / 2.0f, h / 2.0f);
	
	// Clear the entire screen.
	p.setSource(Fog::Argb32(0xFF000000));
	p.fillAll();
	
	p.save();
	
	// Rotate across the screen center point.
	p.transform(createRotationMatrix(cp, _rotate));
	
	// And draw something...
	Fog::LinearGradientF gradient;
	
	//gradient
	gradient.setStart(cp.x - roundw / 2.0f, cp.y - roundh / 2.0f);
	gradient.setEnd(cp.x + roundw / 2.0f, cp.y + roundh / 2.0f);
	gradient.addStop(0.0f, Fog::Argb32(0xFFFFFFFF));
	gradient.addStop(0.5f, Fog::Argb32(0xFFFFFF00));
	gradient.addStop(1.0f, Fog::Argb32(0xFFFF0000));
	p.setSource(gradient);
	
	//p.setSource(Fog::Argb32(0xFFFF0000));

	
	
	p.fillRound(Fog::RoundF(
							Fog::RectF(cp.x - roundw / 2.0f, cp.y - roundh / 2.0f, roundw, roundh),
							Fog::PointF(20.0f, 20.0f)));
	
	p.restore();
}