From 28c8089bc7b13ed8814d864632347f56086f5608 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 5 Jun 2018 19:07:26 +0000 Subject: [PATCH] Rename IGraphicsDevice to IPlatformWindow. --- OpenRA.Game/Graphics/PlatformInterfaces.cs | 4 ++-- OpenRA.Game/Renderer.cs | 4 ++-- OpenRA.Platforms.Default/DefaultPlatform.cs | 4 ++-- OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj | 2 +- OpenRA.Platforms.Default/Sdl2Input.cs | 4 ++-- .../{Sdl2GraphicsDevice.cs => Sdl2PlatformWindow.cs} | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) rename OpenRA.Platforms.Default/{Sdl2GraphicsDevice.cs => Sdl2PlatformWindow.cs} (99%) diff --git a/OpenRA.Game/Graphics/PlatformInterfaces.cs b/OpenRA.Game/Graphics/PlatformInterfaces.cs index fe1ffcc450..2c82d1c194 100644 --- a/OpenRA.Game/Graphics/PlatformInterfaces.cs +++ b/OpenRA.Game/Graphics/PlatformInterfaces.cs @@ -17,7 +17,7 @@ namespace OpenRA { public interface IPlatform { - IGraphicsDevice CreateGraphics(Size size, WindowMode windowMode); + IPlatformWindow CreateWindow(Size size, WindowMode windowMode); ISoundEngine CreateSound(string device); } @@ -34,7 +34,7 @@ namespace OpenRA DoubleMultiplicative } - public interface IGraphicsDevice : IDisposable + public interface IPlatformWindow : IDisposable { IVertexBuffer CreateVertexBuffer(int length); ITexture CreateTexture(Bitmap bitmap); diff --git a/OpenRA.Game/Renderer.cs b/OpenRA.Game/Renderer.cs index 96c158b164..25259e609e 100644 --- a/OpenRA.Game/Renderer.cs +++ b/OpenRA.Game/Renderer.cs @@ -29,7 +29,7 @@ namespace OpenRA public RgbaSpriteRenderer RgbaSpriteRenderer { get; private set; } public IReadOnlyDictionary Fonts; - internal IGraphicsDevice Device { get; private set; } + internal IPlatformWindow Device { get; private set; } internal int SheetSize { get; private set; } internal int TempBufferSize { get; private set; } @@ -51,7 +51,7 @@ namespace OpenRA { var resolution = GetResolution(graphicSettings); - Device = platform.CreateGraphics(new Size(resolution.Width, resolution.Height), graphicSettings.Mode); + Device = platform.CreateWindow(new Size(resolution.Width, resolution.Height), graphicSettings.Mode); TempBufferSize = graphicSettings.BatchSize; SheetSize = graphicSettings.SheetSize; diff --git a/OpenRA.Platforms.Default/DefaultPlatform.cs b/OpenRA.Platforms.Default/DefaultPlatform.cs index 9dd432aaf0..9a6e5b0fff 100644 --- a/OpenRA.Platforms.Default/DefaultPlatform.cs +++ b/OpenRA.Platforms.Default/DefaultPlatform.cs @@ -16,9 +16,9 @@ namespace OpenRA.Platforms.Default { public class DefaultPlatform : IPlatform { - public IGraphicsDevice CreateGraphics(Size size, WindowMode windowMode) + public IPlatformWindow CreateWindow(Size size, WindowMode windowMode) { - return new Sdl2GraphicsDevice(size, windowMode); + return new Sdl2PlatformWindow(size, windowMode); } public ISoundEngine CreateSound(string device) diff --git a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj index 66fe36b528..aeeb61e796 100644 --- a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj +++ b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj @@ -48,7 +48,7 @@ - + diff --git a/OpenRA.Platforms.Default/Sdl2Input.cs b/OpenRA.Platforms.Default/Sdl2Input.cs index f135908ebb..48071d8555 100644 --- a/OpenRA.Platforms.Default/Sdl2Input.cs +++ b/OpenRA.Platforms.Default/Sdl2Input.cs @@ -40,7 +40,7 @@ namespace OpenRA.Platforms.Default | ((raw & (int)SDL.SDL_Keymod.KMOD_SHIFT) != 0 ? Modifiers.Shift : 0); } - int2 EventPosition(Sdl2GraphicsDevice device, int x, int y) + int2 EventPosition(Sdl2PlatformWindow device, int x, int y) { // On Windows and Linux (X11) events are given in surface coordinates // These must be scaled to our effective window coordinates @@ -50,7 +50,7 @@ namespace OpenRA.Platforms.Default return new int2(x, y); } - public void PumpInput(Sdl2GraphicsDevice device, IInputHandler inputHandler) + public void PumpInput(Sdl2PlatformWindow device, IInputHandler inputHandler) { var mods = MakeModifiers((int)SDL.SDL_GetModState()); var scrollDelta = 0; diff --git a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs similarity index 99% rename from OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs rename to OpenRA.Platforms.Default/Sdl2PlatformWindow.cs index 0c71379814..77b9e239be 100644 --- a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs +++ b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs @@ -17,7 +17,7 @@ using SDL2; namespace OpenRA.Platforms.Default { - sealed class Sdl2GraphicsDevice : ThreadAffine, IGraphicsDevice + sealed class Sdl2PlatformWindow : ThreadAffine, IPlatformWindow { readonly Sdl2Input input; @@ -33,7 +33,7 @@ namespace OpenRA.Platforms.Default [DllImport("user32.dll")] static extern bool SetProcessDPIAware(); - public Sdl2GraphicsDevice(Size windowSize, WindowMode windowMode) + public Sdl2PlatformWindow(Size windowSize, WindowMode windowMode) { Console.WriteLine("Using SDL 2 with OpenGL renderer"); WindowSize = windowSize;