Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 91dc253

Browse files
committed
[DirectComposition]
Add per issue #970 Make device classes public (as per generated code) Add a protected empty constructor on Device2 (to allow override for Device3) Add Device3 and All effects that can be constructed by it
1 parent 1536ed4 commit 91dc253

17 files changed

Lines changed: 255 additions & 4 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SharpDX.DirectComposition
8+
{
9+
public partial class AffineTransform2DEffect
10+
{
11+
public AffineTransform2DEffect(Device3 device) : base(IntPtr.Zero)
12+
{
13+
device.CreateAffineTransform2DEffect(this);
14+
}
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SharpDX.DirectComposition
8+
{
9+
public partial class ArithmeticCompositeEffect
10+
{
11+
public ArithmeticCompositeEffect(Device3 device) : base(IntPtr.Zero)
12+
{
13+
device.CreateArithmeticCompositeEffect(this);
14+
}
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SharpDX.DirectComposition
8+
{
9+
public partial class BlendEffect
10+
{
11+
public BlendEffect(Device3 device) : base(IntPtr.Zero)
12+
{
13+
device.CreateBlendEffect(this);
14+
}
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SharpDX.DirectComposition
8+
{
9+
public partial class BrightnessEffect
10+
{
11+
public BrightnessEffect(Device3 device) : base(IntPtr.Zero)
12+
{
13+
device.CreateBrightnessEffect(this);
14+
}
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SharpDX.DirectComposition
8+
{
9+
public partial class ColorMatrixEffect
10+
{
11+
public ColorMatrixEffect(Device3 device) : base(IntPtr.Zero)
12+
{
13+
device.CreateColorMatrixEffect(this);
14+
}
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SharpDX.DirectComposition
8+
{
9+
public partial class CompositeEffect
10+
{
11+
public CompositeEffect(Device3 device) : base(IntPtr.Zero)
12+
{
13+
device.CreateCompositeEffect(this);
14+
}
15+
}
16+
}

Source/SharpDX.DirectComposition/Device.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace SharpDX.DirectComposition
77
{
8-
partial class Device
8+
public partial class Device
99
{
1010
/// <summary>
1111
/// Creates a new device object that can be used to create other Microsoft DirectComposition objects.

Source/SharpDX.DirectComposition/Device2.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55

66
namespace SharpDX.DirectComposition
77
{
8-
partial class Device2
8+
public partial class Device2
99
{
10+
/// <summary>
11+
/// Used for inherited constructors
12+
/// </summary>
13+
protected Device2() { }
14+
1015
/// <summary>
1116
/// Creates a new device object that can be used to create other Microsoft DirectComposition objects.
1217
/// </summary>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace SharpDX.DirectComposition
7+
{
8+
public partial class Device3
9+
{
10+
/// <summary>
11+
/// Creates a new device object that can be used to create other Microsoft DirectComposition objects.
12+
/// </summary>
13+
/// <param name="renderingDevice">An optional reference to a DirectX device to be used to create DirectComposition surface
14+
/// objects. Must be a reference to an object implementing the <strong><see cref="SharpDX.DXGI.Device"/></strong> or
15+
/// <strong><see cref="SharpDX.Direct2D1.Device"/></strong> interfaces.</param>
16+
public Device3(ComObject renderingDevice)
17+
{
18+
IntPtr temp;
19+
DComp.CreateDevice3(renderingDevice, Utilities.GetGuidFromType(typeof(Device3)), out temp);
20+
NativePointer = temp;
21+
}
22+
}
23+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SharpDX.DirectComposition
8+
{
9+
public partial class GaussianBlurEffect
10+
{
11+
public GaussianBlurEffect(Device3 device) : base(IntPtr.Zero)
12+
{
13+
device.CreateGaussianBlurEffect(this);
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)