Added : OpenRA.Renderer.Null

This commit is contained in:
geckosoft
2010-11-01 03:50:21 +01:00
parent 56598ce2ff
commit d050d1a4b9
8 changed files with 263 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using OpenRA.FileFormats.Graphics;
using OpenRA.Graphics;
[assembly: Renderer(typeof(OpenRA.Renderer.Null.NullGraphicsDevice))]
namespace OpenRA.Renderer.Null
{
public class NullGraphicsDevice : IGraphicsDevice
{
public Size WindowSize { get; internal set; }
public NullGraphicsDevice(int width, int height, WindowMode window, bool vsync)
{
WindowSize = new Size(width, height);
}
public void EnableScissor(int left, int top, int width, int height)
{
}
public void DisableScissor()
{
}
public void Begin() { }
public void End() { }
public void Clear(Color c)
{
}
public void Present()
{
Game.HasInputFocus = false;
Game.HandleModifierKeys(Modifiers.None);
}
public void DrawIndexedPrimitives(PrimitiveType pt, Range<int> vertices, Range<int> indices)
{
}
public void DrawIndexedPrimitives(PrimitiveType pt, int numVerts, int numPrimitives)
{
}
public IVertexBuffer<Vertex> CreateVertexBuffer(int size)
{
return new NullVertexBuffer<Vertex>();
}
public IIndexBuffer CreateIndexBuffer(int size) { return new NullIndexBuffer(); }
public ITexture CreateTexture() { return new NullTexture(); }
public ITexture CreateTexture(Bitmap bitmap) { return new NullTexture(); }
public IShader CreateShader(Stream stream) { return new NullShader(); }
}
}