diff --git a/OpenRA.Renderer.Null/NullGraphicsDevice.cs b/OpenRA.Renderer.Null/NullGraphicsDevice.cs new file mode 100644 index 0000000000..b87f1b2856 --- /dev/null +++ b/OpenRA.Renderer.Null/NullGraphicsDevice.cs @@ -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 vertices, Range indices) + { + } + + public void DrawIndexedPrimitives(PrimitiveType pt, int numVerts, int numPrimitives) + { + } + + + public IVertexBuffer CreateVertexBuffer(int size) + { + return new NullVertexBuffer(); + } + + 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(); } + } +} diff --git a/OpenRA.Renderer.Null/NullIndexBuffer.cs b/OpenRA.Renderer.Null/NullIndexBuffer.cs new file mode 100644 index 0000000000..d951c4cdd0 --- /dev/null +++ b/OpenRA.Renderer.Null/NullIndexBuffer.cs @@ -0,0 +1,17 @@ +using OpenRA.FileFormats.Graphics; + +namespace OpenRA.Renderer.Null +{ + public class NullIndexBuffer : IIndexBuffer + { + public void Bind() + { + + } + + public void SetData(ushort[] indices, int length) + { + + } + } +} diff --git a/OpenRA.Renderer.Null/NullShader.cs b/OpenRA.Renderer.Null/NullShader.cs new file mode 100644 index 0000000000..8deaa123c7 --- /dev/null +++ b/OpenRA.Renderer.Null/NullShader.cs @@ -0,0 +1,25 @@ +using System; +using OpenRA.FileFormats.Graphics; + +namespace OpenRA.Renderer.Null +{ + public class NullShader : IShader + { + public void SetValue(string name, float x, float y) + { + + } + + public void SetValue(string param, ITexture texture) + { + } + + public void Commit() + { + } + + public void Render(Action a) + { + } + } +} diff --git a/OpenRA.Renderer.Null/NullTexture.cs b/OpenRA.Renderer.Null/NullTexture.cs new file mode 100644 index 0000000000..9a6caeda65 --- /dev/null +++ b/OpenRA.Renderer.Null/NullTexture.cs @@ -0,0 +1,21 @@ +using System.Drawing; +using OpenRA.FileFormats.Graphics; + +namespace OpenRA.Renderer.Null +{ + public class NullTexture : ITexture + { + public void SetData(Bitmap bitmap) + { + + } + + public void SetData(uint[,] colors) + { + } + + public void SetData(byte[] colors, int width, int height) + { + } + } +} diff --git a/OpenRA.Renderer.Null/NullVertexBuffer.cs b/OpenRA.Renderer.Null/NullVertexBuffer.cs new file mode 100644 index 0000000000..49ed5e83e3 --- /dev/null +++ b/OpenRA.Renderer.Null/NullVertexBuffer.cs @@ -0,0 +1,17 @@ +using OpenRA.FileFormats.Graphics; + +namespace OpenRA.Renderer.Null +{ + class NullVertexBuffer : IVertexBuffer + { + public void Bind() + { + + } + + public void SetData(T[] vertices, int length) + { + + } + } +} diff --git a/OpenRA.Renderer.Null/OpenRA.Renderer.Null.csproj b/OpenRA.Renderer.Null/OpenRA.Renderer.Null.csproj new file mode 100644 index 0000000000..fbec25fa81 --- /dev/null +++ b/OpenRA.Renderer.Null/OpenRA.Renderer.Null.csproj @@ -0,0 +1,75 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981} + Library + Properties + OpenRA.Renderer.Null + OpenRA.Renderer.Null + v3.5 + 512 + + + true + full + false + ..\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\ + TRACE + prompt + 4 + + + + + 3.5 + + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + {BDAEAB25-991E-46A7-AF1E-4F0E03358DAA} + OpenRA.FileFormats + + + {0DFB103F-2962-400F-8C6D-E2C28CCBA633} + OpenRA.Game + + + + + \ No newline at end of file diff --git a/OpenRA.Renderer.Null/Properties/AssemblyInfo.cs b/OpenRA.Renderer.Null/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..a7c065c7e0 --- /dev/null +++ b/OpenRA.Renderer.Null/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenRA.Renderer.Null")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenRA.Renderer.Null")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c7dff231-d517-400e-bc98-ff10c99fd660")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenRA.sln b/OpenRA.sln index 3d1a695d05..833f0652c4 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -29,6 +29,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileExtractor", "FileExtrac EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Renderer.Null", "OpenRA.Renderer.Null\OpenRA.Renderer.Null.csproj", "{0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -124,6 +126,14 @@ Global {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Any CPU.Build.0 = Release|Any CPU {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|Any CPU.Build.0 = Release|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE