aboutsummaryrefslogtreecommitdiffstatsci
path: root/Drawing2D
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-11-24 23:50:38 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-11-24 23:50:38 +0100
commitb25ad7a6e15a7284e40407377a1624747ffe42e5 (patch)
treef53a12fb2120eb7f1b82ccfbda37a2430c5be330 /Drawing2D
parent09026f4328d0e578823062d6506ffdacac457b25 (diff)
IBackend instead of IDevice to bind to Interface
Diffstat (limited to 'Drawing2D')
-rw-r--r--Drawing2D/src/Enums.cs6
-rw-r--r--Drawing2D/src/IBackend.cs37
-rw-r--r--Drawing2D/src/IDevice.cs10
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);
}
}