add a default "no scale" orthographic scaler implementation
This commit is contained in:
parent
c5d996a5e9
commit
621017aa58
|
@ -182,6 +182,7 @@
|
|||
<Compile Include="IServiceLocator.cs" />
|
||||
<Compile Include="BasicGameApp.cs" />
|
||||
<Compile Include="Graphics\IOrthoPixelScaler.cs" />
|
||||
<Compile Include="Graphics\NoScaleOrthoPixelScaler.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
|
31
Blarg.GameFramework/Graphics/NoScaleOrthoPixelScaler.cs
Normal file
31
Blarg.GameFramework/Graphics/NoScaleOrthoPixelScaler.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace Blarg.GameFramework.Graphics
|
||||
{
|
||||
public class NoScaleOrthoPixelScaler : IOrthoPixelScaler
|
||||
{
|
||||
Rect _viewport;
|
||||
|
||||
public void Calculate(Rect viewport)
|
||||
{
|
||||
// no scaling whatsoever!
|
||||
_viewport = viewport;
|
||||
}
|
||||
|
||||
public int Scale
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public int ScaledWidth
|
||||
{
|
||||
get { return _viewport.Width; }
|
||||
}
|
||||
|
||||
public int ScaledHeight
|
||||
{
|
||||
get { return _viewport.Height; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in a new issue