diff options
Diffstat (limited to 'Drawing2D/src')
| -rw-r--r-- | Drawing2D/src/Enums.cs | 6 | ||||
| -rw-r--r-- | Drawing2D/src/IBackend.cs | 37 | ||||
| -rw-r--r-- | Drawing2D/src/IDevice.cs | 10 |
3 files changed, 43 insertions, 10 deletions
diff --git a/Drawing2D/src/Enums.cs b/Drawing2D/src/Enums.cs index 12a6f035..bf20a432 100644 --- a/Drawing2D/src/Enums.cs +++ b/Drawing2D/src/Enums.cs @@ -6,6 +6,12 @@ using System; namespace Drawing2D { + public enum BackendType { + Native, + OpenGL, + EGL, + Vulkan + } public enum Status { Success = 0, diff --git a/Drawing2D/src/IBackend.cs b/Drawing2D/src/IBackend.cs new file mode 100644 index 00000000..811b95d5 --- /dev/null +++ b/Drawing2D/src/IBackend.cs @@ -0,0 +1,37 @@ +// Copyright (c) 2018-2021 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + +using System; +using System.IO; + +namespace Drawing2D +{ + public interface IBackend: IDisposable + { + ISurface CreateSurface (int width, int height); + ISurface CreateSurface (byte[] data, int width, int height); + //ISurface CreateMainSurface (IntPtr glfwWinHandle, int width, int height); + ISurface MainSurface { get; } + IRegion CreateRegion (); + IContext CreateContext (ISurface surf); + //IPattern CreatePattern (PatternType patternType); + IGradient CreateGradient (GradientType gradientType, Rectangle bounds); + byte[] LoadBitmap (Stream stream, out Size dimensions); + ISvgHandle LoadSvg (Stream stream); + ISvgHandle LoadSvg (string svgFragment); + IContext PrepareUIFrame (IContext existingContext, IRegion clipping); + void FlushUIFrame (IContext ctx); + /*IRegion CreateRegion (); + ISurface CreateSurface (int width, int height); + ISurface CreateSurface (byte[] data, int width, int height); + ISurface CreateSurface (IntPtr glfwWinHandle, int width, int height); + IContext CreateContext (ISurface surf); + //IPattern CreatePattern (PatternType patternType); + IGradient CreateGradient (GradientType gradientType, Rectangle bounds); + byte[] LoadBitmap (Stream stream, out Size dimensions); + ISvgHandle LoadSvg (Stream stream); + ISvgHandle LoadSvg (string svgFragment);*/ + } +} + diff --git a/Drawing2D/src/IDevice.cs b/Drawing2D/src/IDevice.cs index 891f8b2e..14846271 100644 --- a/Drawing2D/src/IDevice.cs +++ b/Drawing2D/src/IDevice.cs @@ -13,16 +13,6 @@ namespace Drawing2D void GetDpy (out int hdpy, out int vdpy); void SetDpy (int hdpy, int vdpy); - IRegion CreateRegion (); - ISurface CreateSurface (int width, int height); - ISurface CreateSurface (byte[] data, int width, int height); - ISurface CreateSurface (IntPtr glfwWinHandle, int width, int height); - IContext CreateContext (ISurface surf); - //IPattern CreatePattern (PatternType patternType); - IGradient CreateGradient (GradientType gradientType, Rectangle bounds); - byte[] LoadBitmap (Stream stream, out Size dimensions); - ISvgHandle LoadSvg (Stream stream); - ISvgHandle LoadSvg (string svgFragment); } } |