public BasicLightableScene(Graphics.Graphics graphics)
{
int width, height;
width = graphics.GetGraphicsDeviceManager().GraphicsDevice.Viewport.Width;
height = graphics.GetGraphicsDeviceManager().GraphicsDevice.Viewport.Height;
Camera = new Camera2D();
LightScene = new RenderTarget2D(graphics.GetGraphicsDeviceManager().GraphicsDevice,
width, height);
BaseScene = new RenderTarget2D(graphics.GetGraphicsDeviceManager().GraphicsDevice,
width, height);
_Entities = new List<IAnimatedEntity>();
_StaticLights = new List<LightSource>();
if (!Minecraft2D.ScaleGame)
{
graphics.ResolutionChanged += (sender, e) =>
{
Console.WriteLine("[BasicLightableScene] Destroying and recreating render targets.");
width = graphics.GetGraphicsDeviceManager().GraphicsDevice.Viewport.Width;
height = graphics.GetGraphicsDeviceManager().GraphicsDevice.Viewport.Height;
LightScene.Dispose();
BaseScene.Dispose();
LightScene = new RenderTarget2D(graphics.GetGraphicsDeviceManager().GraphicsDevice,
width, height);
BaseScene = new RenderTarget2D(graphics.GetGraphicsDeviceManager().GraphicsDevice,
width, height);
};
}
}