git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1230 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
beedee
2007-07-14 07:18:48 +00:00
parent dc64b74ceb
commit 9f1d288833
3 changed files with 63 additions and 1 deletions

28
OpenRa.Game/Region.cs Normal file
View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace OpenRa.Game
{
class Region
{
PointF location;
Size size;
Renderable drawFunction;
public Region(PointF location, Size size, Renderable drawFunction)
{
this.location = location;
this.size = size;
this.drawFunction = drawFunction;
}
public void Draw(Renderer renderer, Viewport viewport)
{
renderer.Device.EnableScissor(location.X, location.Y, size.Width, size.Height);
drawFunction(renderer, viewport);
renderer.Device.DisableScissor();
}
}
}